
opensetk/dsh-xiaohei
50Last commit Aug 13, 2026
dsh-xiaohei DSH plugin
dsh-pet is a Host + Browser dual-end plugin that lives in the bottom-right corner of DSH Web UI. It observes session events to display seven distinct moods (idle, busy, thinking, streaming, tool, done, error) and provides playful click feedback. The plugin is a working example of DSH plugin development using the shell.overlay slot.
How to install the dsh-xiaohei DSH plugin
dsh plugin --profile web add github:opensetk/dsh-xiaohei#dsh-pluginCopying does not run this command. Review the repository and version before installing the dsh-xiaohei DSH plugin.
dsh-xiaohei DSH plugin data source
dsh-xiaohei DSH plugin snapshot date: Aug 16, 2026
discovered
What the dsh-xiaohei DSH plugin can do
- Real-time mood switching based on agent status events (e.g., turn/start, step/start, assistant/chunk).
- Click interaction: random animation and bubble text on pet click.
- Fallback mechanism: uses useSessions snapshot when polling fails, ensuring pet always has a display.
- Pure function mood state machine (src/moods.ts) that can be replayed and reused across sessions.
- Fully pluginized: host side registers via session/event listener, browser side injects into shell.overlay slot.
Where the dsh-xiaohei DSH plugin fits
- Visually monitor agent status in DSH Web UI during development or debugging.
- Add a fun, interactive element to the DSH Web UI for better user experience.
- Learn DSH dual-end plugin architecture by studying the provided source code and build scripts.
- Quickly identify errors or issues with agent sessions via the pet's error mood.
Who the dsh-xiaohei DSH plugin is for
- DSH users and developers who want real-time visual feedback from agent sessions.
- Developers interested in creating DSH plugins using the Host + browser client pattern.
dsh-xiaohei DSH plugin limitations
- Only tested and verified with DSH 0.1.0-rc.6; other versions may require API adjustments.
- Requires a local DSH environment and build process that reuses packages from the DSH installation.
- Pet assets are sourced from public resources and are for learning purposes only; not suitable for production use without proper licensing.
- When polling fails, mood derivation falls back to coarse-grained snapshot data, which may be less accurate.
dsh-xiaohei DSH plugin: from the repository README
Quoted from the opensetk/dsh-xiaohei README, the upstream source of the dsh-xiaohei DSH plugin. Copyright remains with the original authors.
一颗住在 **DSH Web UI** 右下角的桌面宠物:跟随 agent 的运行状态实时切换姿态, 点击还能获得俏皮反馈。是一个完整的 **Host + 浏览器双半** Web UI 插件示例, 所有 API 均按 DSH `0.1.0-rc.6` 实测验证。 - 宿主半(Node):监听持久化 `session/event`,折叠出每会话的宠物姿态 - 浏览器半(`dsh.client` bundle):注册进 `shell.overlay` 全局浮层槽位,渲染宠物形象 - 姿态状态机是纯函数(`src/moods.ts`),可回放重建,与实时事件流同一套逻辑 --- ## 效果预览 <p align="center"> <img src="docs/screenshots/QQ_1786634277517.png" alt="dsh-pet 效果截图 1" width="70%"> </p> <p align="center"> <img src="docs/screenshots/QQ_1786634322842.png" alt="dsh-pet 效果截图 2" width="70%"> </p> <p align="center"> <img src="docs/screenshots/QQ_1786634371357.png" alt="dsh-pet 效果截图 3" width="70%"> </p> --- ## 它做什么 宿主侧逐事件折叠出**七种姿态**,浏览器经 HTTP 路由 `/pet-mood?sessionId=…` 轮询(800ms): | 姿态 | 触发事实(`session/event`) | 宠物表现 | |---|---|---| | 空闲 `idle` | 无活动 | 😴 陪着你~ | | 忙碌 `busy` | `turn/start` | 👋 摇摆「忙忙哒」 | | 思考 `thinking` | `step/start` | 🍗 吃鸡腿「边想边吃…」 | | 输出 `streaming` | `assistant/chunk`(`text-delta` 非空文本) | 🏃 奔跑「冲鸭鸭!」 | | 干活 `tool` | `tool/call`(结果未回) | 🎮 玩嘿咻「和嘿咻玩会儿~」 | | 完成 `done` | `assistant/message` / `tool/result` 成功 | 🎉 庆祝「耶!搞定~」 | | 受挫 `error` | `turn/end` 失败(`reason.kind` 为 `error`/`aborted`)/ `tool/result` 带 `error` | 🤸 翻滚「呜哇…」 | 鼠标点击宠物 → 随机播放一个互动
Read the full READMERepository license: MIT
dsh-xiaohei DSH plugin questions
How do I install dsh-pet into my DSH Web UI?
First ensure you have DSH 0.1.0-rc.6 installed. Then run `dsh plugin --profile web add github:opensetk/dsh-xiaohei#dsh-plugin` in your profile directory. After that, add the host plugin line to `~/.dsh/profiles/web/cordis.patch.yml` as described in the README, and restart DSH with `dsh web`. The pet should appear in the bottom-right corner.
The pet is not showing up at all. What should I do?
Check that you have declared the dependency in your profile's `package.json` and inserted the host plugin line in `cordis.patch.yml`. Also verify that the page sources show `window.__DSH_BOOT__` contains an entry with `"id": "dsh-pet"`. If not, rebuild the client bundle using `node scripts/build.mjs` and refresh the browser with a hard reload (Cmd+Shift+R).
The pet is stuck and doesn't change moods when the agent runs. How to fix?
This often happens when the `useSessions` selector returns a constant value. Make sure your client bundle uses `useSessions((s) => s)` to get the latest snapshot. Also clear the browser cache with a hard refresh. If the issue persists, check that the host plugin is registering events correctly and that the `/pet-mood` route returns valid JSON.
I see a 'failed to import loader entry' error in the console. What does it mean?
This error indicates that `lib/client.js` was not built with the correct registration format. It must start with `window.__ModuleLoader__.load({id:"dsh-pet",...`. Re-run `node scripts/build.mjs` to rebuild the bundle. Make sure you are using the provided build script and not a different bundler that might output a different format.
Can I customize the pet's appearance or add my own animations?
The pet assets are currently inlined as data URLs from the `assets/` folder. You can replace the GIF/PNG files in `assets/` and rebuild the bundle using `node scripts/build.mjs`. However, note that the assets are sourced from public resources and are for learning purposes only. If you use custom assets, ensure you have the rights to use them. The mood state machine and animation logic can also be modified in `src/moods.ts` and `src/client/Pet.tsx`.