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

@freespace8/dsh-free-vision

v0.1.2

Published

Local image understanding for the DeepSeek Harness: OCR, table-layout detection, and semantic description of textless images via macOS Vision, fully on-device (images never leave your Mac). 本地化识图,图片不出本机。

Readme

@freespace8/dsh-free-vision

License: MIT 平台: macOS

DeepSeek Harness 的本地化识图插件:用 macOS Vision 框架在本机理解图片(图片永不离开你的 Mac),并把能力暴露为 agent 可调用工具,适配无视觉能力的模型(如 DeepSeek v4 Flash)。

English · 简体中文


目录

功能

  • view_image — 无文字图片的语义理解:场景分类、人物/动物/人脸检测(九宫格方位)、二维码/条形码解码、构图焦点、美学评分;检测到文字时提示改用 OCR;
  • ocr_image — 提取图片全部文字(阅读顺序,支持中英文);layout=true 时输出表格结构与归一化坐标,适合长截图、文档照片、表格页面;
  • 粘贴图片 → 本地路径(Web GUI):在输入框 ⌘V 粘贴图片,自动保存到本地目录并把绝对路径插入草稿,模型可直接用该路径调用上面两个工具。

预览

对一张含中文、英文与表格的文档运行 ocr_image 的真实效果——完全本地处理:

dsh-free-vision 预览

输入支持:http(s) 链接 / base64 / 本机绝对路径。安全边界:下载拒绝本机/内网地址(防 SSRF);上传仅接受 loopback、按字节大小限流、按魔数嗅探扩展名(不信任客户端文件名)。

前置条件

  • DeepSeek Harness,带运行中的 web profile;
  • macOS 11+ 与 Xcode Command Line Tools(xcode-select --install)。首次调用 swift 需编译约 5~10s,之后有缓存。

安装

已发布到 npm,一条命令安装(目标 profile 为 web):

dsh plugin --profile web add @freespace8/dsh-free-vision

安装后重启 web profiledsh plugin add 只改 manifest 与依赖,运行中的实例不热加载新 bundle)。卸载:

dsh plugin --profile web remove @freespace8/dsh-free-vision

配置

profile 的 cordis.patch.yml 里按 id 覆盖(整段替换 config):

- id: free-vision
  config:
    scriptPath: ""              # ocr.swift 绝对路径;留空使用插件内置脚本
    timeout: 120000             # swift 执行超时(毫秒),首次运行需编译请留足
    saveDir: ""                 # 粘贴图片保存目录;默认 ~/Pictures/dsh-free-vision
    maxImageSize: 20971520      # 粘贴图片大小上限(字节),默认 20MB

工作原理

  • host 半体src/index.js + src/swift.js + src/upload.js):注册 view_image / ocr_image 两个工具(ctx.tools.register);图片输入归一化(本地路径 / http / base64) 后经 ctx.subprocess spawn swift scripts/ocr.swift(进程组管理、有界输出、超时/取消终止); 另注册 /plugins/dsh-free-vision/images 上传路由(webServer 懒注册,headless 下自动跳过);
  • client 半体lib/client.js):注册 conversation.input.right slot 条目(渲染 null), 在输入框捕获图片粘贴,逐张 POST 上传路由,把返回的绝对路径追加进草稿(inputActions.setDraft)。

工具输出契约:output.schema = { type: 'string' }render 返回 [{ type: 'text', text }] blocks 数组(dsh-session 对 tool-result 块的硬要求)。

验证

npm run check   # 产物门检查(语法、导出形状、exports/files、patch 行、client id、脚本存在)

真实生效验证(装进 profile 后):重启 web profile → 新开会话 → 在输入框粘贴一张含文字的截图 → 草稿里出现本地绝对路径 → 让模型调用 ocr_image(传该路径)→ 返回图片文字。

许可证

MIT,见 LICENSEscripts/ocr.swift 及部分 host/client 逻辑衍生自 niyongsheng/free-vision-skill (MIT,Copyright (c) 2026 Nico);上游版权声明与许可文本保留在 LICENSE 中。