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

@liangjiehappy/dsh-plugin-doctor

v0.1.4

Published

DSH 插件开发检测工具:静态符合性检查(manifest/patch/代码/依赖四层)、失败原因解释、沙箱提交

Readme

@liangjiehappy/dsh-plugin-doctor

DSH 插件开发检测工具。在提交沙箱之前,先在本地把装不上的原因找出来。

为什么有这个

2026-11-10,我自己写的一个插件在沙箱里报 install_failed,但错误信息只有一行:

dsh: initialized profile web at /home/node/.dsh/profiles/web

那是最后一行日志,不是错误。真实原因是:

Error: cannot get property "config" without inject

inject 只写了 ["tools","skills"],代码却读了 ctx.config。Cordis 在未声明时禁止访问,entry 直接不激活。

这一类错误完全可以静态检测出来。 这个插件就是干这个的。

安装

dsh plugin --profile web add @liangjiehappy/dsh-plugin-doctor

三个工具

plugin_check — 静态符合性检查

plugin_check(dir="/path/to/my-plugin")

四层逐项判定:

| 层 | 查什么 | |---|---| | L1 manifest | name / version / main / dsh.bundle.patch / files / engines.dsh | | L2 patch | YAML 合法性、顶层数组、insert、entry 的 id+name、@ 引号 | | L3 代码 | ESM、apply 函数、ctx 属性访问 vs inject 声明、相对 import 存在性、硬编码路径 | | L4 依赖 | file: 路径、peerDependencies 版本范围 |

输出示例:

[L3 代码]
  ✓ 有 export function apply
  ✓ 有 export const name
  ✓ 是 ESM 模块
  ✗ 访问了未在 inject 里声明的 ctx 属性  —  config
      → export const inject = [...现有, "config"]
      → 或改用 try/catch 包住访问。
      → 注意:Cordis 会直接抛 "cannot get property \"X\" without inject",
      → 导致 entry 激活失败,沙箱表现为 install_failed。

plugin_explain — 解释失败原因

plugin_explain(key="code.inject")

可解释的类型:

  • code.inject — ctx 属性未声明 inject
  • patch.at — YAML 里 @ 没引号
  • manifest.engines.upper — 版本写了上界
  • manifest.files.patch — files 漏 patch 文件
  • deps.file — file: 依赖
  • code.apply — 缺 apply 函数

每个都给出:原因、症状、修法。

plugin_submit — 提交沙箱

plugin_submit(plugin="@scope/name")
plugin_submit(plugin="@scope/name", mode="result")   # 查结果

提交到 deepseekbase 沙箱做四阶段测试(安装/列装/挂载/启动)。

一个技能

plugin-dev-guide —— 完整的插件开发指南,含:

  • 最小可安装插件模板
  • manifest 必填字段
  • cordis.patch.yml 写法(含 @ 引号陷阱)
  • engines.dsh 为什么只写下界
  • ctx 访问契约(2026-11 新增)
  • 五个最常见的失败模式
  • 发 npm 之前的自检清单

它自己就是例子

本插件严格遵守它自己检查的东西:

  • package.json 有 dsh.bundle.patch
  • files 含 lib 与 patch 文件
  • patch 里 @ 已加引号
  • engines.dsh 只写下界
  • inject 只声明真正用到的(["tools","skills"])
  • 完全不碰 ctx.config —— 这正是 2026-11-10 那个 bug 的来源

限制

  • 只做静态检查,不做运行时验证。真正能不能装,要提交沙箱。
  • 不写任何文件、不执行命令,只读目录 + 发 HTTPS 请求。
  • YAML 解析是手写的极简版,覆盖插件需要的子集,不是完整 YAML 解析器。

许可

MIT

相关

  • DSHIO 标准:https://dshio.org/
  • 插件市场:https://deepseekbase.com/
  • 官方文档:https://github.com/deepseek-ai/deepseek-harness/tree/master/docs

本插件是第三方项目,与 DeepSeek 无隶属关系。