dsh plugins中文
← Back to popular plugin directory

Luo Xiaohei desktop pet

opensetk/dsh-xiaohei · tools

Luo Xiaohei's desk pet, who lives in the lower right corner of DSH Web UI, will switch postures and respond to clicks according to the running status of the agent.

★ 5GitHub stars
0Forks
2026-08-14Last updated
TypeScriptLanguage
MITLicense

Project overview

一颗住在 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),可回放重建,与实时事件流同一套逻辑 效果预览 它做什么

鼠标点击宠物 → 随机播放一个互动动画(吃鸡腿 / 偷吃 / 玩嘿咻 / 蠕动 / 翻滚)+ 气泡文案。 轮询不可用时回退到 useSessions 快照粗粒度推导(running/pendingInteraction/completed), 保证宠物永远有表现。 架构 姿态来源:宿主半逐事件维护七态(服务端消费、回放、跨会话一致); 浏览器半轮询该路由渲染,轮询不可用时回退 useSessions 快照粗粒度推导。 素材来源

apply(ctx) 里所有注册都是 ctx 副作用,插件卸载自动清理(HMR 不留残留): 坑:Cordis 里 ctx. 属性访问必须先声明 inject,否则抛 cannot get property "…" without inject,且该错误会被事件系统静默吞掉 (监听器看着"不生效")。用 ctx.get('…') 方法调用即可。 浏览器侧

Install command

dsh plugin --profile web add github:opensetk/dsh-xiaohei
View GitHub repository ↗Back to popular plugin directory