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

@weibaohui/dsh-plugin-kit

v0.3.0

Published

dsh 插件共享工具箱:AI 动作分享抽屉(ntd ActionButton 同款交互)+ 宿主任务执行器,供系列插件复用

Readme

@weibaohui/dsh-plugin-kit

npm version

@weibaohui/dsh-plugin-kit

npm version

dsh 插件共享工具箱。把系列插件中重复的「AI 动作按钮」能力收拢为一处:

  • 宿主createShareRunJob —— 把提示词交给真实 agent 会话执行(进程内 agents 服务优先流式,缺失降级 headless spawn;30 分钟超时 + 输出截断),任务状态由调用方轮询
  • clientPluginKit.ActionShareDialog —— ntd ActionButton 同款交互(模板参数输入 + 可编辑提示词 + 参数预览 + 复制 + 执行 + 实时输出 + 完成态插槽),全内联样式,消费者无需自带 CSS

消费方式

// 插件 package.json(npm 源;dsh plugin add 时作为传递依赖一次性装上)
"dependencies": { "@weibaohui/dsh-plugin-kit": "^0.1.0" }

dsh plugin add 安装插件时作为传递依赖一次性装上。

宿主

const { createShareRunJob } = require('@weibaohui/dsh-plugin-kit')
const job = createShareRunJob({ binary: 'dsh', prompt, dir, jobs: shareRunJobs, logger: ctx.logger, services: shareServices })

client(构建期内联)

client/index.js 顶部声明,构建脚本把 client/source.js 内联进 bundle:

const ShareDialog = PluginKit.makeActionShareDialog(__React)
// 分享态(最小用法)
// h(ShareDialog, { title, hint, rows, initialPrompt, run, poll, labels, onClose })
// 创建/生成态(模板参数 + 完成态插槽,ntd ExpertCreateModal 同款)
// h(ShareDialog, {
//   title, hint,
//   params: [{ key: 'description', label: '描述', multiline: true }],   // {{description}} 实时替换进 prompt
//   initialPrompt: TEMPLATE,
//   run, poll,
//   completedView: ({ job, output, close, retry }) => node,             // job done 后由插槽接管渲染
//   labels, onClose,
// })

params 值实时替换进 prompt,用户手改过 prompt 后参数变化不再覆盖(脏跟踪); completedView 接管后 Dialog footer 置空,确认/重试/关闭按钮由插槽自承。

设计决策

  • 构建期内联而非运行时插件:kit 不进 profile 的 bundle 图,无降级逻辑;消费者构建时把 client 源码打进自己的 bundle,dsh plugin add 时宿主代码经 npm 传递依赖装齐——一次性装上,无挖坑
  • 协议无关:run/poll 以函数注入,提示词模板归各插件自有(业务层),kit 只收骨架