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

@little_monkey/dsh-inline-image-read

v1.0.0

Published

Inline preview of AI-read images in the DSH conversation.

Readme

dsh-inline-image-read

DSH Web 插件:把 AI 用 read_image 读取的图片直接渲染在会话流里,不需要先点开工具卡片。

默认的宿主行为是:read_image 调用在会话中只显示一行「读取图片 · 路径」,图片收在卡片展开后的正文里。本插件替换 read_image 的 tool.call.toolview 视图,在行内常驻显示缩略图(单图最大 240×180,点击看大图),保留标题与路径;其它工具行不受影响。

使用

  1. 安装后刷新页面。
  2. 让 AI 读取任意本地图片(read_image 工具)。
  3. 会话里出现「读取图片 · 路径」行时,行内直接显示缩略图;点击缩略图打开大图,Esc 或点背景关闭。
  4. 历史会话重新打开后图片依然在(引用来自会话日志里的持久化附件,不依赖原文件是否还在)。

实现位置

  • 槽位:tool.call.toolview(keyed,key = read_image,session 作用域),按宿主规则「注册已占用的 key 会替换该视图」覆盖官方 ReadImageRow。
  • 替换必须显式带 priority: -1(低于官方条目的 0)。实测在已占用的 key 上用相同 priority 注册会被拒绝,并连带让整个插件激活失败(slot 目录里 read-image-toolview 仍是 active);这也是首版没有生效的原因。
  • 图片数据:tool/result 事件里已结算结果的 content 中的 image block(attachmentId、mediaType、bytes、宽高、可选 originalDimensions),由会话日志持久化,不读原文件。
  • 取图:使用宿主通过 owner props 注入的 loadImage(attachment)(会话授权;内部为 session.attachment RPC + ctx.uiConversation.imageUrl() 的 blob URL 缓存),因此不需要 Host 半边、不新增 HTTP 路由、不跨会话越权。
  • 样式:只使用 --dsw-alias-* 主题 token(缺省时给 --dsw-radius-lg 等非颜色 token 兜底),不 require 任何 Harness Client 包。
  • 文案:插件自带 zh / en 字典,经 ctx.locale.register 注册。

已知限制

  • 图片只在工具调用结算后出现;preparing / start 阶段仍是标题+路径。
  • 只覆盖 read_image;其它返回图片的工具(MCP 等)仍走官方通用卡片。
  • 替换了官方 read_image 卡片,因此不显示官方的「检查调用(trajectory inspect)」按钮、原始展开详情(参数/结果原文)。路径与尺寸信息保留。
  • 宿主升级若改动 read_image 卡片或 tool.call.toolview 契约,本插件需要跟进修复。
  • 会话中图片行很多时,每张缩略图会各自触发一次附件 RPC(同一附件有缓存,只有一次网络请求)。

安装 / 卸载

  • 安装:plugin_manager action=install_bundle target=<本目录绝对路径>(profile 级,对所有会话生效)。
  • 卸载:plugin_manager action=remove_bundle target=@little_monkey/dsh-inline-image-read。
  • 修改 client.js 后,开发期 HMR 会重载客户端插件;若页面仍用旧代码,刷新一次页面。