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-agimage

v1.0.0

Published

常驻版 Agnes AI 图片生成工具(原动态插件 img-2 / Image Generation Tool v13 固化交付):注册 generate_image 模型工具,结果图在会话内以 240px 上限 + 宽高比适配显示。

Readme

dsh-agimage

常驻版 Agnes AI 图片生成工具 — 原动态插件 img-2(Image Generation Tool v13, pkg-15)固化交付。

组成

| 文件 | 作用 | | --- | --- | | lib/index.js | Host 半:把 generate_image 模型工具注册进宿主 tools 注册表(经 PowerShell 调 Agnes AI API,下载 PNG,show=true 时存为会话附件),并注册 /agimage/ webServer 路由服务工作区里的 PNG | | lib/client.js | 浏览器半:在 tool.call.toolview 注册 generate_image 卡片,结果图 240px 上限 + 宽高比适配显示(经 meta.localUrl 拉取本地路由,回退 readAttachment) | | cordis.patch.yml | bundle patch manifest(dsh plugin add 通道用) |

挂载方式

已手动挂载于 ~/.dsh/profiles/web/cordis.patch.yml:

- insert:
    - id: agimage
      name: 'dsh-agimage'

DSH 每次启动(web profile)自动加载;进程重启即常驻,不再依赖动态插件。

迁移说明

  • Host 半:harness.defineTool/registerTool → ctx.tools.register({...})(内联 JSON Schema,含 output.render / presentationMeta),与官方 tools 服务契约一致。
  • Client 半:动态 return {inject, apply} → window.__ModuleLoader__.load({id, factory}) 标准 client bundle,由 dsh-client-modules 经 dsh.client manifest 编入页面。
  • API Key / 默认工作区(C:\Users\XIAOPAN\Desktop\dsh)与原动态插件一致。

模型上下文约束(重要)

工具结果 render 纯文本:只有 Image generated successfully + Requested prompt,不带图片 block / URL / base64。 模型永远看不到图片(修掉早期"路由转多模态丢消息"的 bug)。UI 显示走 /agimage/<task>.png webServer 路由(trust-fence 同 dsh-dream-skin),不依赖模型上下文。

参数(v2)

| 参数 | 类型 | 必填 | 说明 | | --- | --- | --- | --- | | prompt | string[] | ✅ | 每项生成一张图,数量不限(自动排队限速) | | size | string | ❌ | 档位 1K/2K/3K/4K 或历史精确尺寸 1024x768/768x1024/1024x1024,默认 1K | | ratio | string | ❌ | 与档位 size 配合:1:1/3:4/4:3/16:9/9:16/2:3/3:2/21:9,默认 1:1 | | image | string[] | ❌ | 参考图(公共 HTTPS URL / data URI base64 / 本地文件路径 / sha256 引用,自动解析),图生图 / 多图合成 | | show | boolean | ❌ | 默认 true(自动显示在会话内);大批量可传 false 跳过显示 |

限速(按尺寸档位自动生效)

| 档位 | 速率 | 令牌桶 | | --- | --- | --- | | 1K / 精确尺寸 | 20 请求/分钟 | 容量 2,补 1/3s | | 2K | 10 请求/分钟 | 容量 1,补 1/6s | | 3K / 4K | 1 请求/分钟 | 容量 1,补 1/60s |

503(槽位满)→ 立即重试;429(限流)→ 等 3s 重试;单张最多 30 次尝试。 AI 传任意数量 prompt,插件自动排队,以最快可靠速度全部完成。

升级

改动 lib/*.js 后重启 DSH(host 侧)并刷新页面(client 侧)即热生效。