dsh-tentacle
Give DeepSeek Harness eyes and hands: live click-through screen preview plus real mouse/keyboard control on Windows.
- Stars
- 0
- Language
- JavaScript
- Created
- Oct 21, 2026
- Updated
- Oct 21, 2026
Introduction
dsh-tentacle
给鲸鱼娘一双眼睛和一只手。
English:Give DeepSeek Harness a pair of eyes and a hand — live screen capture with a click-through preview panel, plus real mouse and keyboard control on Windows.
- 眼睛:
screen_look把屏幕截成 JPEG 落盘,模型用read_image真看;Web GUI 里还有一个 可拖动、可缩放的实时预览面板,点一下画面就能反向操作你的电脑。 - 手:
pc_control用真实的 Win32SendInput驱动鼠标键盘——点击、双击、右键、拖动、滚轮、 打字(含中文/emoji)、快捷键。 - 刹车:
pc_pause或面板上的「暂停」是同一个急停开关;暂停后只能看,不能动。
只支持 Windows:截屏靠 Pillow,输入注入靠 SendInput。
组成
| 文件 | 作用 |
|---|---|
helper/tentacle.py | 常驻 Python 助手:Pillow 截屏 + ctypes SendInput 输入注入,stdio JSON 行协议 |
lib/index.js | Host 半:四个工具 + /tentacle/{frame,state,pause,input} 路由,管理助手进程与限流 |
lib/client.js | 浏览器半:左下角「鲸鱼之眼」浮窗,190ms 拉一帧,转发点击/拖拽/滚轮/打字 |
cordis.patch.yml | 把插件插进 profile 的层栈 |
工具
screen_look
screen_look(max_width=1280, quality=55, monitor=0, grid=false, region={x,y,width,height})
返回 { ok, path, imageWidth, imageHeight, origin, scaleX, scaleY, screenRect, cursor, activeWindow, monitors }。
- 图片默认缩到 1280 宽,
scaleX = 屏幕宽 / 图像宽,图像坐标 × scaleX + origin.x就是屏幕坐标。 grid:true会在图上画红色坐标网格,标签直接就是屏幕物理像素,可以直接喂给pc_control。region是屏幕像素的裁剪框,用来放大局部看清细节(高分辨率下找小按钮用)。- 暂停时依然能截屏:看不受刹车影响。
pc_control
pc_control(action="click", x=962, y=540)
pc_control(action="type", text="你好,鲸鱼娘")
pc_control(action="hotkey", keys=["ctrl","s"])
动作:move / click / double_click / right_click / middle_click / drag / scroll /
type / key / hotkey / wait。坐标一律是屏幕物理像素。
pc_state
显示器布局、屏幕尺寸、光标位置、前台窗口、助手健康状态、面板心跳。很便宜,动手前先看一眼。
pc_pause
急停 / 恢复,和预览面板的按钮共用同一个状态。
面板
左下角浮窗,标题「鲸鱼之眼」:
- 实时画面(约 5 fps),拖头部移动,右下角拖拽改大小;
- 在画面上左键点 = 点击、双击 = 双击、右键 = 右键、按住拖 = 拖动、滚轮 = 滚动;
- 底部可以给前台窗口打一段字,或者点
Esc/Enter/Tab/Backspace; - 「暂停」= 急停;「×」收起,点左下角 👁 再出来;
- 位置和大小存在 localStorage。
安装
dsh plugin --profile web add dsh-tentacle
装完重启 dsh web,刷新页面,左下角就会出现「鲸鱼之眼」。
不走 npm 也可以直接从 GitHub 装:
dsh plugin --profile web add github:githu-mensk/dsh-tentacle
手动安装也行:
// ~/.dsh/profiles/desktop/package.json
{
"dependencies": { "dsh-tentacle": "link:E:/dswork/plugins/dsh-tentacle" },
"dsh": { "profile": { "bundles": [ /* ... */, "dsh-tentacle" ] } }
}
然后 pnpm install,重启 DeepSeek Harness。浏览器半要刷新页面才出现。
安全
- 急停是进程内的共享开关,面板和工具都听它的;暂停期间
pc_control直接拒绝。 - 所有路由先过
connection.requestRejection,非本地连接一律拒绝。 - 截图落在
$DSH_HOME/storages/tentacle/look/,只保留最近 40 张。 - 删文件、卸载、付款、发送这类破坏性点击,模型仍然要先问过你。
回滚
从 profile 的 bundles 里删掉 dsh-tentacle,删掉 dependency,重启即可;
插件目录 E:\dswork\plugins\dsh-tentacle 可以整个删掉。
限制
- 只支持 Windows(
SendInput+PIL.ImageGrab)。 - 靠 Pillow 截屏,1280 宽一帧约 70–90ms,所以面板实际 5–8 fps,不是 60 帧视频。
- 高 DPI 下会自动声明 per-monitor aware,坐标是物理像素,不是逻辑像素。
- 多显示器:
monitor选第几块屏,all_monitors:true截整个虚拟桌面;点击坐标是虚拟桌面绝对坐标。