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-qr-toolkit

v0.1.1

Published

QR code & barcode toolkit for DeepSeek Harness: decode images (PNG/JPEG, local or URL) and generate QR codes as PNG. 二维码/条码工具箱:解码与生成。

Downloads

370

Readme

dsh-qr-toolkit

二维码 / 条码工具箱 —— DeepSeek Harness(DSH)插件。给模型提供两个工具:

  • qr_decode:解码图片中的二维码 / 条形码(本地路径或 http(s) URL,PNG/JPEG)
  • qr_generate:把文本 / 链接生成二维码 PNG,保存到会话工作区

双引擎解码:jsqr(截图类二维码最准)优先,失败自动切换 @zxing/library(MultiFormatReader,支持 QR / Code128 / EAN / UPC / DataMatrix 等)。纯 JS 实现,零原生依赖,Node ≥ 22.19。

安装

# 方式一:dsh CLI(推荐)
dsh plugin --profile web add dsh-qr-toolkit

# 方式二:npm 装进 profile
cd ~/.dsh/profiles/web        # Windows: C:\Users\<你>\.dsh\profiles\web
npm install dsh-qr-toolkit --save

重启 dsh web 后生效(插件会通过 dsh.bundle 自动加入 profile 层)。

用法(模型侧)

| 工具 | 参数 | 说明 | |---|---|---| | qr_decode | source:本地路径或 URL | 返回 content(解码文本)、format(码制)、engine(jsqr/zxing);未识别到返回 error | | qr_generate | text(必填)、size(128-2048)、fileName | 返回 PNG 文件路径,输出到 <会话工作区>/.dsh-qr/ |

示例:把聊天里的二维码截图丢给 agent,qr_decode 直接读出内容;或者让 agent 把一段链接生成二维码 PNG 供分享。

配置(cordis 层,均可选)

- id: tool-qr
  name: dsh-qr-toolkit
  config:
    maxInputBytes: 20971520   # 单张图片上限(默认 20MB)
    outputDir: .dsh-qr       # 生成输出子目录(相对会话工作区)
    timeoutMs: 30000         # 工具超时

工作原理

  • 图片识别按魔数(magic bytes)区分 PNG/JPEG(其他格式明确报错,避免误读)
  • URL 输入用 Node 内置 fetch 下载,与本地文件一样受 maxInputBytes 限制
  • 解码顺序:jsQR → @zxing/library;两者都未命中返回"未识别"而不是抛错
  • 生成用 qrcode 库,误差校正级别 M,边距 2 模块

安全

  • 只读输入图片(本地读文件 / URL 下载),生成仅写入会话工作区 .dsh-qr/
  • 无网络外发:除你显式给的 URL 外,插件不发起任何网络请求
  • 输入大小硬上限防 OOM;AbortSignal 全程透传,支持取消

开发

npm install
npm test          # node --test tests/

License

MIT

赞助 / 打赏

如果这个插件帮到了你,欢迎请作者喝杯咖啡(微信收款码):

微信打赏

也欢迎到 GitHub 提 Issue / PR 一起完善。