Zum Hauptinhalt springen
Q

dsh-native-shot

qing8-max/dsh-native-shot

Screenshot button in the DSH composer (Windows): drag a region that snaps to other windows, annotate or crop it, and insert the result into the prompt. Captures the screen in-process and leaves no file on disk. Both HTTP routes require host authentication through ctx.connection.requestRejection.

Installation

dsh plugin --profile web add github:qing8-max/dsh-native-shot

README

dsh-native-shot

微信风格的截图按钮,装进 DeepSeek Harness 的输入框。Windows 原生实现,不调用系统截图工具,不落任何文件。

功能

  1. 点 📷 → 窗口自动最小化 → 抓取全屏 → 窗口恢复
  2. 拖出区域(选框自动吸附屏幕上其它窗口的边缘,虚线为参考框)
  3. 松手进入编辑器
  4. 编辑完点「✓ 插入」,图直接进输入框

框选

操作效果
拖动画出矩形,四条边靠近窗口边缘时自动吸附
双击直接截全屏
Esc取消

编辑器

工具说明
画笔6 种颜色、3 档粗细(2/4/8 px),自由画线标注
撤销按钮或 Ctrl+Z,最多回退 20 步
裁剪切到裁剪模式,重新拖一个矩形,插入时只保留该区域
✓ 插入确认并把图放进输入框
取消丢弃本次截图

环境要求

项要求
系统Windows 10 / 11(x64)
DeepSeek Harness>=0.2.2-rc.1 <0.3.0-0
其它依赖系统自带的 powershell.exe

安装

通过 DSH 插件市场安装,或 npm install dsh-native-shot。

实现方式

宿主侧(index.js)注册两条路由:

路由作用
GET /dsh-native-shot/capture最小化自身窗口 → CopyFromScreen 抓全屏 → 恢复窗口,返回 PNG
GET /dsh-native-shot/windows枚举可见窗口矩形(供吸附)

抓屏走 PowerShell + System.Drawing,窗口操作走 Win32 ShowWindow,并调用 SetProcessDPIAware 保证坐标与截图一致。

客户端(client.js)注册到 conversation.composer.dock 插槽,负责框选层、带画笔和裁剪的编辑器,最后合成一次 paste 事件把图交给 DSH 的草稿。

已知限制

  • 仅支持 Windows 桌面会话,远程/无头环境不适用。
  • 截取整个虚拟屏幕(含多显示器),框选层按截图等比显示。
  • 屏幕上可见窗口超过 40 个时,只有前 40 个参与吸附。
  • 不支持滚动长截图(该能力已移除)。

许可

MIT

Ähnliche Plugins