npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-visual-plugin

v0.4.1

Published

Local-first visual media plugin for DeepSeek Harness: local video preprocessing, native vision, copyable image history, and video playback.

Readme

dsh-visual-plugin

DeepSeek Harness 插件。

视频预处理及插件媒体存储均在运行 DSH 的机器上完成。图片与提取的关键帧通过 DSH 发送给当前配置的模型;模型推理是否在本地运行,取决于你的 DSH 模型配置。

特性

  • 原生图片理解 —— 上传图片始终走 DSH 原生附件与模型链路;插件不再配置或调用独立视觉模型。
  • 可复制的图片历史 —— 右侧面板在图片缩略图旁记录当前 DSH 模型的最终回答,支持展开历史和一键复制。
  • 插件自有视频上传 —— 支持 MP4、M4V、MOV、AVI、MPG/MPEG、MKV 和 WebM;扩展名、文件签名与 FFprobe 结果必须一致。
  • 视频场景解析 —— 统一转为 H.264/yuv420p MP4,通过 PySceneDetect 提取关键帧,再将有序、带时间戳的图片交给当前 DSH 视觉模型。
  • 右侧面板 —— 在图片/视频视图间切换,直接播放标准化视频,并将选中视频写入会话草稿。
  • 视频高级设置 —— 可在插件设置卡中调整上传大小、存储配额、时长、输出尺寸、FPS、CRF 和关键帧数量。

工作原理

图片 → DSH 原生附件 → 当前视觉模型 → 最终回答
  → /vision-bridge/recent → 面板缩略图 + 可复制描述

视频 → 容器校验 → H.264/yuv420p 标准化 → PySceneDetect
  → 带时间戳关键帧 → DSH 原生图片附件 → 当前模型回答

插件不会改写模型消息,也不会调用私有视觉接口。发送图片或询问视频前,请在 DSH 中选择支持图片输入的模型。

快速开始

插件 0.4.x 面向 DSH 0.2.0-rc.2;旧版 DSH 0.1.x 请继续使用插件 0.3.2。升级无需启用版本风险豁免。

1. 安装宿主环境依赖

图片功能无需安装以下工具。视频功能需要 FFmpeg/FFprobe >= 6.1(同一主版本)、包含 libx264 编码器的 FFmpeg,以及 PySceneDetect >= 0.7.1 < 0.8。

请在运行 dsh web 的机器及用户环境中安装依赖。ffmpeg、ffprobe 和 scenedetect 必须加入该进程的 PATH,可以从任意目录直接调用。如果 DSH 运行在 Docker、WSL 或远程服务器中,请在对应运行环境内安装依赖。

macOS(Homebrew)

若尚未安装 Homebrew,请先安装并按照其安装后提示将 brew 加入 PATH。然后安装 FFmpeg(包含 FFprobe)和 uv:

brew install ffmpeg uv

Arch Linux(pacman)

安装官方仓库中的 FFmpeg 和 uv:

sudo pacman -Syu ffmpeg uv

Windows(PowerShell、WinGet)

打开 PowerShell,执行 winget --version 确认 WinGet 可用。若缺少该命令,请按链接中的说明安装或更新 应用安装程序(App Installer)。在 Windows x64 上安装 FFmpeg(包含 FFprobe)和 uv:

winget install --id Gyan.FFmpeg --exact
winget install --id astral-sh.uv --exact

安装后关闭并重新打开 PowerShell,使新的 PATH 生效,再继续下面的步骤。如果无法使用 WinGet,可从 FFmpeg 下载页 获取 Windows 构建,解压到 C:\Tools\ffmpeg 等固定目录,并在 环境变量 中将包含 ffmpeg.exe 和 ffprobe.exe 的目录(通常为 bin)添加到当前用户的 Path;uv 则按其 Windows 官方安装说明 安装。

使用 uv 安装 PySceneDetect(三种系统通用)

在终端或 PowerShell 中执行:

uv tool install --python 3.12 "scenedetect>=0.7.1,<0.8"
uv tool update-shell

该方式将 PySceneDetect 安装为当前用户可直接调用的持久命令,并使用独立环境。uv 会在需要时下载 Python 3.12;标准 scenedetect 包包含所需的 OpenCV 依赖。启动 DSH 前无需激活虚拟环境。详见 uv 工具安装文档 和 PySceneDetect 安装说明。

2. 验证依赖

执行 uv tool update-shell 后,关闭并重新打开终端。在即将启动 DSH 的同一环境中执行:

ffmpeg -version
ffprobe -version
ffmpeg -hide_banner -encoders
scenedetect version

确认 FFmpeg 和 FFprobe 均为 >= 6.1 且主版本一致,编码器列表包含 libx264,PySceneDetect 为 >= 0.7.1 < 0.8。

若提示找不到命令,在 macOS/Arch 中执行 command -v ffmpeg ffprobe scenedetect,在 PowerShell 中执行 Get-Command ffmpeg, ffprobe, scenedetect,确认命令位置。uv tool dir --bin 可查看 PySceneDetect 的命令目录,该目录需要加入 PATH。通过服务或容器启动 DSH 时,也应配置相应的 PATH,修改后重启 DSH 进程。

插件不会自动下载依赖或执行安装脚本。缺少依赖时图片功能仍可用,设置页会列出视频依赖问题。

3. 安装插件

dsh plugin --profile web add dsh-visual-plugin   # 或:github:jyh20030112/dsh-visual-plugin

若使用本地 DeepSeek Harness 源码开发,请改为链接本地插件目录:

cd /absolute/path/to/dsh-visual-plugin
npm run bootstrap
dsh plugin --profile web add link:/absolute/path/to/dsh-visual-plugin

bootstrap 要求已安装、构建的 dsh-v0.2.0-rc.2 Harness 检出,并自动查找同级或祖先目录。其他布局请显式指定:

HARNESS=/absolute/path/to/deepseek-harness npm run bootstrap

4. 重启并使用

在通过上述依赖验证的环境中重启 dsh web,然后:

  1. 打开 设置 → 插件,选择 dsh-visual-plugin 详情页中的 视觉媒体 配置。通过 侧边栏 开关控制右侧面板,并按需调整视频解析高级设置。设置保存到当前 profile,立即生效且重启保留;升级会恢复旧设置归档中的有效视频参数,不覆盖已保存的新参数。

  2. 在 DSH 中选择支持图片输入的模型;插件不再提供单独的视觉模型配置。

  3. 发送图片。当前模型会原生回答,图片面板会记录缩略图和最终回答,方便复制。

  4. 点击输入框旁的 上传视频。处理完成后在右侧选择 视频 播放;点击 在会话中提问 只会写入草稿,确认后再发送。

视觉模型

图片与视频关键帧均由 DSH 当前选择的视觉模型理解。模型提供方、接口和凭据统一由 DSH 管理,插件不再重复配置。

卸载

dsh plugin --profile web remove dsh-visual-plugin

重启 dsh web。该命令会在 profile 内转发执行 pnpm remove,bundle 层列表会自动同步移除该插件。

项目结构

src/
  index.ts      原生图片历史、video_describe 工具、设置与 HTTP 路由
  config.ts     视频解析高级设置与运行时策略
  video/        上传、容器探测、转码、场景检测、关键帧与 HTTP Range 播放
  client/       图片/视频面板、上传控件、高级设置、文案与样式
cordis.patch.yml  bundle 补丁层

构建

npm run bootstrap && npm run typecheck && npm run build   # 需要本地 harness 检出

预构建 lib/ 已提交,使用者无需构建。

CI/CD

ci.yml 在每次 push/PR 校验产物与打包内容;release.yml(tag v*)校验版本、打包、创建 GitHub Release 并发布到 npm。

相关资源

友情链接

致谢

  • HsiangNianian — 感谢开发过程中的帮助与建议。
  • tingfeng347 — 感谢构建稳定性修复与本地 harness 开发环境的完善。
  • dsh-auto-continue — 网络错误等异常导致请求被中断时自动发送「继续」恢复的 DSH 插件(错误分类、自适应退避、浏览器通知),很好用的搭配。

许可证

MIT