dafeiyu-dsh-plugins (dafeiyu-screensense)
marx-otto/dafeiyu-dsh-plugins/dafeiyu-screensense
Screen-sense mode for the dsh-pet desktop pet: captures the primary display every 30 seconds, compares an 8x8 average hash of each frame, and sends the screenshot to the session model when the frame changed (and again after the idle interval even if unchanged) so the pet comments in one short bubble line. Adds /fish, /fish_look and /fish_screen commands, a status and control HTTP pair, and a change threshold plus an idle repeat interval that can be tuned in the plugin config. Windows only (PowerShell WinForms).
インストール
dsh plugin --profile web add github:marx-otto/dafeiyu-dsh-pluginsこのプラグインはリポジトリの dafeiyu-screensense サブディレクトリにあります。
README
大肥鱼识屏 · DSH 桌宠插件
给 DeepSeek Harness(DSH)的桌面桌宠 dsh-pet 加上「识屏模式」:桌面上的大肥鱼会定时看一眼你的屏幕,主动吐槽,也能看着屏幕跟你聊天。
两个插件配套使用:只装
pet-menu菜单会出来但点了没反应;只装screensense就没有右键入口。
| 插件 | 版本 | 作用 |
|---|---|---|
dafeiyu-screensense | 1.1.0 | 识屏本体:定时截屏、画面变化检测、主动吐槽、看着屏幕聊天 |
dafeiyu-pet-menu | 1.0.0 | 给桌面右键菜单加「识屏模式」入口(开启 / 关闭 / 识别间隔) |
特性
- 定时识屏:默认每 30 秒截一张主屏,缩到 1280 宽 JPEG。
- 不瞎说话:8×8 均值哈希比较画面,画面没变化就静默,零模型调用、零 token。
- 主动吐槽:画面变化时把截图交给当前模型,用大肥鱼的口吻说一句(≤60 字),气泡显示在桌宠上。
- 看着屏幕聊天:
/fish <消息>让大肥鱼结合当前画面回你。 - 右键菜单:识屏模式 → 开启识屏 / 关闭识屏 / 识别间隔(15 / 30 / 60 / 120 秒),开和关都会用气泡回话。
- 两端同步:走 dsh-pet 的
POST /dsh-pet-7340/broadcast,浏览器 overlay 和桌面小窗看到同一份内容。
环境要求
- 已安装 DeepSeek Harness(DSH),桌面模式可正常显示桌宠。
- 已安装 dsh-pet 0.3.x(只在 0.3.7 上验证过)。
- Windows:截屏脚本依赖 PowerShell 的
System.Windows.Forms+System.Drawing。
安装
方式一:Release 安装包(推荐)
-
到 Releases 下载最新的
dafeiyu-dsh-plugins-v*.zip,解压到不带中文的路径。 -
在 DSH 里对 AI 说:
用 plugin_manager install_bundle 安装这两个目录:
<解压目录>\dafeiyu-screensense<解压目录>\dafeiyu-pet-menu -
安装需要完全访问权限,会弹一次批准;装完
dafeiyu-pet-menu会自动重启桌面助手。 -
若菜单没出现:右键大肥鱼 →「重载配置」。
方式二:从源码目录安装
git clone https://github.com/marx-otto/dafeiyu-dsh-plugins.git
cd dafeiyu-dsh-plugins
npm pack --pack-destination dist ./dafeiyu-screensense
npm pack --pack-destination dist ./dafeiyu-pet-menu
然后同样用 install_bundle 指向上面的两个目录,或用 dsh plugin add 安装生成的 .tgz。
使用
右键桌面大肥鱼:「回到初始位置」下面会出现 识屏模式:
- 开启识屏 → 气泡回「识屏模式:开啦!我盯着你的屏幕咯~」
- 关闭识屏 → 气泡回「识屏模式:关啦,我先眯一会儿~」
- 识别间隔 → 15 / 30 / 60 / 120 秒
命令:
| 命令 | 作用 |
|---|---|
/fish <消息> | 结合当前屏幕画面聊天 |
/fish_look | 立刻看一眼屏幕 |
/fish_screen on / off | 开 / 关识屏 |
/fish_screen <秒数> | 改间隔(≥10 秒) |
/fish_screen status | 查看当前状态 |
HTTP 接口:
GET /dafeiyu-screensense/status—— 当前开关、间隔、上次截图时间等POST /dafeiyu-screensense/control—— 开 / 关 / 改间隔(右键菜单就是调它)
配置(dafeiyu-screensense)
写在 cordis.patch.yml 的 config 里,改完重载该插件行即生效。
| 键 | 默认值 | 说明 |
|---|---|---|
enabled | true | 是否启用识屏 |
intervalSec | 30 | 截屏间隔(秒) |
idleRepeatSec | 120 | 画面不变时,隔多久允许再主动说一句 |
changeThreshold | 6 | 哈希差异阈值,越大越不敏感 |
maxWidth | 1280 | 截图缩放后的宽度 |
jpegQuality | 72 | JPEG 质量 |
maxChars | 60 | 单次吐槽最大字数 |
chatMemoryRounds | 6 | /fish 聊天保留的上下文轮数 |
firstLookDelaySec | 8 | 开启后首次截屏的延迟 |
provider / model | 空 | 留空则跟随当前会话的默认模型 |
petId | 空 | 指定桌宠实例,一般留空 |
dafeiyu-pet-menu 只有一个开关:enabled。
隐私与费用
- 截图会发给你当前选择的模型服务商(截图作为图片消息随请求发出),只在开启识屏时发生。
- 画面没变化时不会调用模型,不会产生 token 消耗。
- 介意隐私的话,别在开着识屏时处理敏感内容,或直接把间隔调大 / 关掉。
兼容性与风险
dafeiyu-pet-menu 是补丁插件:dsh-pet 没提供右键菜单扩展接口,所以它会:
- 找到
node_modules/dsh-pet/runtime/electron-helper/renderer.js; - 首次修改前备份为
renderer.js.dafeiyu.bak; - 追加带
dafeiyu-pet-menu v1标记的 IIFE 补丁。
补丁是幂等的(已有标记就跳过)。dsh-pet 升级后补丁可能被覆盖,重装或重启本插件会自动补回。菜单依赖 dsh-pet 0.3.x 的 shared-core 实现,大版本升级后菜单可能不出现,但不会弄坏宠物。
卸载
- 在 DSH 插件管理里停用 / 移除
dafeiyu-pet-menu和dafeiyu-screensense。 - 想彻底还原右键菜单:把
renderer.js.dafeiyu.bak覆盖回renderer.js,再「重载配置」。
开发
npm pack --pack-destination dist ./dafeiyu-screensense
npm pack --pack-destination dist ./dafeiyu-pet-menu
两个包都带 dsh.bundle.patch,装进 profile 后由 DSH 的插件管理器加载。