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

@hyzyn/dsh-prompt

v0.2.7

Published

DSH Web GUI 的 Prompt 管理插件:可视化编辑 systemPrompt,带版本管理与 A/B 分流,可导出 / 导入 / 复制分享,配置存于 ~/.dsh/prompts.yml 的托管区块。

Readme

@hyzyn/dsh-prompt

中文 | English

DSH 设置 → 插件 里的「Prompt 管理」卡片:可视化编辑 systemPrompt,带版本管理与 A/B 测试。配置存在 ~/.dsh/prompts.yml(可用 DSH_PROMPT_FILE 覆盖)。

特性

  • Prompt 与版本两级模型:一个 Prompt 存多份版本,存为新版本 / 回滚各一步,旧版本完整保留。
  • A/B 按比例随机分流:按比例命中 A/B 版本,用真实流量验证提示词改动。
  • 启用即作为 systemPrompt section 注入:选中即注入,保存即热生效。
  • 可导出、可导入:导出 json / markdown,导入 JSON,亦可一键复制分享。

Prompt 管理卡片:可视化编辑 / 版本管理 / A/B 测试

路由

仅限 loopback + 同源访问:

  • GET /api/dsh-prompt/list —— 列出全部 Prompt 与激活状态
  • POST /api/dsh-prompt/save —— 新建 / 整体保存 Prompt
  • POST /api/dsh-prompt/activate —— 启用某个 Prompt(可指定激活版本;promptId 为空表示停用)
  • POST /api/dsh-prompt/abtest —— 配置 A/B 测试
  • POST /api/dsh-prompt/delete —— 删除 Prompt
  • GET /api/dsh-prompt/active —— 查看当前注入 systemPrompt 的文本与命中版本
  • GET /api/dsh-prompt/export?format=json|markdown&promptId=... —— 导出
  • POST /api/dsh-prompt/import —— 导入 JSON

安装

pnpm --filter @hyzyn/dsh-prompt build
dsh plugin --profile web add link:$(pwd)/packages/prompt

插件自身行由 cordis.patch.yml 的 insert: { id: prompt-manager, name: '@hyzyn/dsh-prompt' } 挂载;保存 Prompt 后宿主会立即刷新 systemPrompt section,无需重启。

配置

设置面在宿主里的位置随 DSH 版本变,但始终是同一份表单:0.2.0-rc.1 起挂 plugins.bundle.config——插件详情页「说明」正下方内联,不必再点「>」进二级页;旧宿主 (0.1.6 线)自动回退到侧边栏「插件」页里该行的「>」子页,≤0.1.5 用设置页卡片。

interface Config {
  /** 关闭整个插件。默认 false。 */
  enabled?: boolean
  /** 是否向 agent 注入插件能力公告。默认 true。 */
  announceToAgent?: boolean
  /** 是否把启用的 Prompt 注入 systemPrompt。默认 true。 */
  applyToSystemPrompt?: boolean
}

说明

  • 托管区块以 # --- dsh-prompt-manager managed ... 标记,插件只改写该区块,其余内容原样保留。
  • 每个 Prompt 至少需要一个版本;版本内容最大 500KB。
  • A/B 测试的随机选择发生在 systemPrompt 刷新时(保存/启用/启动),适合快速对比不同 system prompt 文案;如需按会话粒度分流,可在上层接入实验平台。
  • 浏览器半体依赖核心 slots 服务,只有 dsh-web-app 的官方设置面板才提供该插槽。