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-chat-image

v0.1.1

Published

Renders chat Markdown image references (![alt](path title)) as a gallery under each closing assistant message

Downloads

478

Readme

dsh-chat-image

npm 版本 GitHub

English | 中文

DeepSeek Harness 的 Web GUI 中,把聊天消息里的 Markdown 图片引用(![alt](路径 title))渲染成助手回复下方的图片画廊。

  • 本地工作区路径 通过经过校验的宿主路由(/dsh-chat-image)加载:路径必须解析到已注册工作区内、且为不超过 32 MiB 的普通文件;按扩展名返回对应的内容类型。
  • http(s) 引用自动跳过——内置 Markdown 渲染器本来就会内联显示它们。
  • data: URL 直接渲染。
  • 可选的 title 显示为图片下方的说明文字与悬浮提示;没有 title 的本地文件以绝对路径作为悬浮提示。
  • 加载失败的引用(文件缺失、工作区之外、超出字节上限)回退为替代文字;替代文字为空则该条不渲染。
  • 点击本地图片会通过工具行同款宿主打开器打开文件。

安装

作为独立 bundle,在 dsh 安装环境中:

# 从 npm
dsh plugin --profile web add dsh-chat-image

# 从 git 仓库
dsh plugin --profile web add github:Niobium-41-nb/dsh-chat-image

# 从 tarball
dsh plugin --profile web add ./dsh-chat-image-0.1.0.tgz

git 安装会拉取源码并运行包的 prepare 构建;pnpm ≥ 10 需要为该脚本显式放行构建权限(add 的输出会打印需要加进 pnpm-workspace.yaml 的确切条目)。web profile 的浏览器花名册(clientModules)会通过 dsh.client 清单自动发现浏览器半边;Loader 通过 bundle patch 挂载宿主半边。

用法

模型在回复中写出普通的 Markdown 图片引用即可:

![架构图](docs/architecture.png "架构总览")
![](my image.png)      <!-- 含空格的路径需要用尖括号 -->
![inline](data:image/png;base64,AAAA)

相对路径按会话工作目录解析;绝对路径(盘符、/\\)直接通过。仅作用于助手回复的关闭回合:用户消息下没有尾部插槽,且同一回合存在产物文件时保留产物行(画廊仅在它放弃时显示)。

开发

pnpm install
pnpm test      # vitest:路由状态矩阵 + 引用提取契约
pnpm build     # tsc 类型(lib/types)+ tsdown 打包(lib/index.js、lib/client.js)

浏览器 bundle 是面向 dsh 加载器的 CJS 包装(window.__ModuleLoader__.load),仅冻结的平台模块表保持 external;node half 无任何运行时导入。两个半边都以结构性类型消费宿主服务,因此本包除平台模块外不携带任何 @deepseek-ai/* 的运行时或类型依赖。

已知限制

  • 仅助手关闭回合。 尾部插槽只存在于关闭的助手消息下。
  • 与产物文件行互斥。 同一回合既有产物文件又有图片引用时,只显示产物文件行(优先级更高)。
  • CommonMark 目标语法。 含空格的路径必须用尖括号(<my image.png>)包裹;不带引号的多词目标会被解析为「路径 + 标题」。
  • 工作区包含规则。 只服务工作区内的文件;其余一律返回 403,因此该路由无法读取任意宿主文件。