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

@qzsy/dsh-image-viewer

v0.3.1

Published

iPhone Photos-style full-screen image viewer for the DSH conversation: zoom from thumbnail, pinch/double-tap zoom, momentum pan, swipe between images, swipe down to close; annotate an image and drop it into the chat box.

Readme

@qzsy/dsh-image-viewer

DeepSeek Harness 客户端插件:把对话流里图片的“点击查看原图”换成一个接近 iPhone 相册的全屏查看器。

安装

dsh plugin add @qzsy/dsh-image-viewer

安装后刷新 GUI 页面即可生效。卸载:dsh plugin remove @qzsy/dsh-image-viewer,内置的原图查看器会恢复。

交互

触屏(手机 / 平板):

  • 从缩略图位置放大打开,关闭时缩回原位(含裁切与圆角过渡)
  • 双指缩放,以手指中点为焦点;超出范围有橡皮筋回弹
  • 双击放大到点击位置,再双击还原
  • 放大后拖动带惯性,到边缘回弹;拖到边缘继续拖即切到相邻图片
  • 左右滑动切换同一对话中的所有图片,按距离或速度判定翻页
  • 上下滑动关闭,背景随拖动距离变淡;回拉可取消
  • 双指捏小到原尺寸以下松手即关闭
  • 单击显示 / 隐藏顶部工具栏和底部缩略图条

桌面:

  • 滚轮 / Ctrl+滚轮 / 触控板双指捏合缩放,鼠标位置为焦点
  • 触控板左右轻扫翻页;放大后滚动即平移
  • 拖动平移,双击缩放,单击图片外区域关闭
  • 键盘:Esc 关闭,← → 翻页,+ - 缩放,0 还原
  • 工具栏:计数、缩放切换、下载、关闭;底部缩略图条可直接跳转

系统开启“减少动态效果”时,所有动画直接跳到终态。

桌面端窗口边缘

DSH 桌面应用(Electron)会把 Windows 右上角的窗口按钮、macOS 左上角的红绿灯画在网页之上。查看器和标注编辑器的顶栏按宿主发布的安全边距(--dsh-frame-overlay-top,Windows 为标题栏高度 + 20px,macOS 为 68px,原生全屏时降到 20px)下移,不会落在窗口按钮下面;同时图片的最大显示宽度固定为视口的 90%,标注画布同理,任何窗口尺寸下都不会被顶栏或窗口控件遮挡。

标注后发送

查看器顶部的铅笔按钮打开标注编辑器(类似 ChatGPT / iOS 标记):

  • 工具:画笔、形状(矩形 / 椭圆 / 箭头 / 直线,按住 Shift 画正方形或 45° 线)、橡皮擦(按笔画整笔擦除)
  • 左侧竖条调粗细,底部选颜色,最左侧色环可自定义颜色
  • 撤销 / 重做(Ctrl/⌘+Z、Ctrl/⌘+Shift+Z、Ctrl+Y),Enter 完成,Esc 返回查看器
  • 双指缩放 / 平移画布;桌面上 Ctrl+滚轮缩放,中键拖动平移;用 Apple Pencil 时手指只用于缩放平移
  • 点 ✓ 后导出 PNG(超过 8 MB 改为 JPEG),以粘贴的方式放进对话输入框,查看器关闭,光标留在输入框,补充提示词后即可发送
  • 找不到输入框时改为下载图片;来自其他站点且不允许跨域的图片,浏览器会禁止导出,会给出提示

图片文件链接

消息里的 Markdown 链接如果指向图片文件(例如 [选品中心](docs/acceptance/prod/mobile-leader-products.png)),点击也走这个查看器,而不是打开文件面板:

  • 悬停时鼠标变成放大镜,提示这里可以点开看图
  • 同一段消息里的多个图片链接组成一个相册,可以左右滑动切换
  • 图片地址直接复用 DSH 已解析好的文件地址;桌面端把 dsh-app:// 地址改写成同源 http 地址,标注后导出不会被 canvas 跨域拦下
  • 目标不是图片的普通文件链接、以及输入框里的 @文件 引用,仍按原样打开

工作方式

插件只有客户端部分,不注册任何 Host 能力,不发起网络请求。它在 document 捕获阶段监听点击:

  • 带 cursor: zoom-in 的按钮(对话中的 Markdown 图片、消息附件图片、输入框附件缩略图)
  • 指向图片文件的文件链接按钮(见上一节)
  • 或面积不小于 96×64 的裸 <img>

命中后阻止内置查看器(或文件面板),并收集同一滚动区域内的全部可预览图片作为相册。

以下情况保持原样:按住 Ctrl / ⌘ / Shift / Alt 点击、图片在链接内、位于导航栏 / 工具栏 / 菜单中、在可编辑区域内或输入框里,或元素(及其祖先)带有 data-qiv-ignore 属性。

开发

bun run build      # dist/index.js + dist/client.js
bun run typecheck
node test/smoke.mjs    # jsdom 冒烟测试:查看器
node test/layout.mjs   # jsdom 布局测试:90% 宽度上限与桌面窗口留白
node test/editor.mjs   # jsdom 冒烟测试:标注与注入输入框

许可

MIT