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-rule-manager

v0.1.0

Published

统一管理 DSH 规则:编辑全局规则 ~/.dsh/AGENTS.md、编辑项目 AGENTS.md、LLM 自动拆分项目规则为分层 AGENTS.md + skills。合并自 dsh-global-rules 与 dsh-rule-splitter。

Readme

dsh-rule-manager

Awesome DSH Plugin

统一管理 DSH 规则的插件:全局规则 + 项目规则编辑 + LLM 自动拆分,三个功能收进设置面板的一个「规则管理」入口。

合并自 dsh-global-rulesdsh-rule-splitter,所有 HTTP 路由与原插件保持一致,升级无破坏。

功能 / Features

  • 全局规则:编辑 ~/.dsh/AGENTS.md,保存实时生效(新会话立即生效;当前会话在下次文件操作后感知)
  • 项目规则:选择工作区,编辑其根目录/子目录的任意 AGENTS.md
  • 自动拆分:粘贴项目规则,LLM 自动拆分为「精简总纲 + 按需加载的 .dsh/skills/<主题>/SKILL.md」;支持直接覆盖 / 合并保留原规则两种模式,覆盖前自动备份,先预览后写盘

零构建:Client 端为手写 __ModuleLoader__ bundle,Host 端为纯 Node ESM。

安装 / Install

dsh plugin --profile web add dsh-rule-manager

升级自旧插件:先卸载 dsh-global-rulesdsh-rule-splitter,再安装本插件,避免两个「规则」设置入口并存。

重启 dsh web,打开 设置 → 规则管理

使用 / Usage

  1. 打开 设置 → 规则管理
  2. 三个 tab 按需使用:全局规则(写 ~/.dsh/AGENTS.md)、项目规则(选工作区 + 规则文件编辑)、自动拆分(粘贴规则 → 选模型 → 预览 → 确认生成)

工作原理 / How it works

  • Hostlib/index.js):注册 7 个 HTTP 路由
    • GET/POST /global-rules —— 读写 ~/.dsh/AGENTS.md(同源校验 + 256 KiB 上限)
    • GET /rule-splitter/workspaces —— 工作区列表
    • GET /rule-splitter/models —— 模型目录
    • GET/POST /rule-splitter/rules —— 项目规则读写
    • GET /rule-splitter/rule-files —— 规则文件列表
    • POST /rule-splitter/split —— LLM 拆分(预览,不写盘)
    • POST /rule-splitter/apply —— 确认写盘(覆盖前备份)
  • Clientlib/client.js):手写 window.__ModuleLoader__.load bundle,注册 settings.section 的「规则管理」页面(三个 tab)
  • 生效机制:依赖 DSH 内置 dsh-agent-instructions 的动态检测,无需插件做热重载

目录结构 / Structure

dsh-rule-manager/
├── cordis.patch.yml   # bundle patch:插入 rule-manager 层
├── lib/
│   ├── index.js       # Host:HTTP 路由(Node ESM)
│   └── client.js      # Client:设置页 UI(__ModuleLoader__ bundle)
├── test-smoke.mjs     # Host 冒烟测试(node test-smoke.mjs)
└── package.json

故障排查 / Troubleshooting

  • 设置里看不到「规则管理」入口:重启 dsh web 后刷新页面;确认插件已加入 profile 的 dsh.profile.bundles
  • 升级自旧插件后出现多个规则入口:卸载 dsh-global-rules / dsh-rule-splitter(本插件已合并两者,路径完全兼容)。
  • 「自动拆分」提示模型调用失败:在拆分 tab 重新选择 provider / model;规则内容过长时先精简再试(单次上限 256 KiB,超时 180 秒)。
  • 保存后当前会话未感知新规则:属预期行为——新规则在新会话立即生效,当前会话在下次文件操作后感知(由 dsh-agent-instructions 动态检测)。

开发 / Development

node test-smoke.mjs   # 运行 host 冒烟测试(mock 服务,无需真实 DSH 环境)

License

MIT