lisusuba/Hardworking-donkey ↗★ 0

dsh-donkey-mill

A donkey treadmill background for the DSH Web UI: a top-down donkey pulls the millstone at a pace driven by the model's live token throughput.

包名
dsh-donkey-mill
兼容性
待验证
版本
1.0.0
许可证
MIT
最近更新
2026年11月11日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add dsh-donkey-mill

2. 确认 bundle 层已进入组合配置(应能看到 # == dsh-donkey-mill 层)

dsh --profile web --dump-config


然后在 Harness 的 **设置 → 插件(Plugin Manager)** 中确认 `dsh-donkey-mill` 已启用,刷新页面即可看到背景与右下角控制面板。

本地开发目录安装:

```sh
dsh plugin --profile web add /path/to/Hardworking-donkey

卸载:

dsh plugin --profile web remove dsh-donkey-mill

配置

插件行 id 为 donkey-mill,包名为 dsh-donkey-mill。bundle 默认配置(cordis.patch.yml):

字段类型默认值说明
enabledbooleantrue是否启用插件
modeanimated | textanimated渲染形态:俯视动画驴 / 汉字
sizenumber (160–720)380场景宽度(px),映射到轨道占视口短边的比例
opacitynumber (0.05–1)0.55水印整体不透明度
showReadoutbooleantrue是否在底部显示 N tok/s 读数
position字符串枚举bottom-right历史字段,保留兼容但已忽略(场景始终全屏居中)

说明:Web 端当前以右下角控制面板 + localStorage 为准(形态 / 透明度 / 显隐)。 配置项已在宿主侧声明并通过 schema 校验;在宿主重启后默认值生效,之后以面板设置为准。

工作原理

  • 宿主半边 (index.js):订阅 agent/assistant-stream 事件,按 attempt 维护 EMA 平滑的 token 吞吐 (综合 usage 与 text-delta/reasoning-delta/tool-call-delta 估算), 通过精确路由 GET /api/donkey-mill/rate 暴露 {"rate": , "active": }。
  • Web 半边 (client.js):注册在 shell.overlay 槽(order: -100,点击穿透), 每 300ms 轮询速率路由,用 rAF 在单个 SVG 上直接写属性;两种形态共用同一套运动学 (空闲保底角速度 + tok/s 加速)。零运行时依赖,不需要构建。

兼容性

  • 仅 Web UI(platform: "web"),使用 shell.overlay 槽与 webServer 精确路由。
  • 在 dsh 0.2.0-rc.2 上开发与验证。
  • 主题色使用 DSH 主题令牌(--dsw-alias-*),自动适配亮/暗主题。

仓库结构

package.json        # bundle 清单(dsh.bundle / dsh.client)
cordis.patch.yml    # Loader patch 层:插入 donkey-mill 行
index.js            # 宿主半边:token 吞吐 → /api/donkey-mill/rate
client.js           # Web 半边:shell.overlay 背景 + 控制面板
icon.svg            # 插件图标
locale/{en,zh}.json # 插件显示名与描述

许可证

MIT © 2026 lisusuba


English

What it is

dsh-donkey-mill replaces the DSH Web UI background with a "donkey pulling the millstone" scene: a top-down donkey walks a circular track, and the faster the model streams tokens, the faster the donkey and millstone spin. When the model is idle it keeps plodding slowly instead of freezing.

Two forms, switchable live:

  • text — a large 「磨」 (mill) in the centre, a 「驴」 (donkey) orbiting the circular track, and the millstone rotating 1:1 with the orbit. Quiet calligraphy feel (KaiTi-first font stack).
  • animated — a top-down cartoon donkey: swinging legs, flicking tail, kicked-up dust, millstone turning as it walks.

A collapsible control panel in the bottom-right corner switches the form, adjusts opacity, or hides the background. Settings persist in localStorage; no config edit or host restart required.

Install

From npm (recommended — prebuilt package, no build approval):

dsh plugin --profile web add dsh-donkey-mill

Or straight from GitHub:


### 配置

插件行 id 为 `donkey-mill`,包名为 `dsh-donkey-mill`。bundle 默认配置(`cordis.patch.yml`):

| 字段 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| `enabled` | boolean | `true` | 是否启用插件 |
| `mode` | `animated` \| `text` | `animated` | 渲染形态:俯视动画驴 / 汉字 |
| `size` | number (160–720) | `380` | 场景宽度(px),映射到轨道占视口短边的比例 |
| `opacity` | number (0.05–1) | `0.55` | 水印整体不透明度 |
| `showReadout` | boolean | `true` | 是否在底部显示 `N tok/s` 读数 |
| `position` | 字符串枚举 | `bottom-right` | 历史字段,保留兼容但已忽略(场景始终全屏居中) |

> 说明:Web 端当前以**右下角控制面板 + localStorage** 为准(形态 / 透明度 / 显隐)。
> 配置项已在宿主侧声明并通过 schema 校验;在宿主重启后默认值生效,之后以面板设置为准。

### Configuration

The plugin row id is `donkey-mill` and the package name is `dsh-donkey-mill`. Bundle defaults
(`cordis.patch.yml`):

| Field | Type | Default | Meaning |
| --- | --- | --- | --- |
| `enabled` | boolean | `true` | Enable the plugin |
| `mode` | `animated` \| `text` | `animated` | Rendering form: top-down donkey or Chinese characters |
| `size` | number (160–720) | `380` | Scene width (px), mapped to the track's share of the viewport's short side |
| `opacity` | number (0.05–1) | `0.55` | Overall watermark opacity |
| `showReadout` | boolean | `true` | Show the `N tok/s` readout at the bottom |
| `position` | enum | `bottom-right` | Legacy field, accepted but ignored (the scene is always full-viewport centred) |

> On the Web side the **control panel + `localStorage`** are authoritative for form / opacity / visibility.
> The row config is declared and schema-validated on the host; defaults apply after a host restart and the
> panel takes over afterwards.