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

@duke-dsh-plugins/dsh-model-prompt-injector

v1.0.1

Published

为 DeepSeek Harness 中本地已配置的模型追加系统提示词:按 provider/model 精确匹配或服务商级通配(provider/*)注入到系统提示词末尾,设置面板逐模型管理,规则持久化、重启不丢。

Readme

dsh-model-prompt-injector

DeepSeek Harness(DSH)中本地已配置的模型追加系统提示词的插件:按 provider/model 精确匹配(或 provider/* 服务商级通配)把规则文本注入到系统提示词末尾,在设置面板中逐模型管理,规则持久化保存、重启不丢

功能

  • 按模型注入:每次向模型发起请求时,命中规则的提示词追加到系统提示词末尾(内置段落排序之后,order 9950),对主会话、子代理(subagent / workflow)同样生效。
  • 两级规则provider/* 服务商级规则对该服务商所有模型生效;provider/model 模型级规则只对该模型生效;两者同时存在时按「服务商级 → 模型级」顺序叠加。
  • 设置页管理:设置 → 「模型提示词」页自动列出本地已配置的服务商与模型(与「模型」设置页同一数据源),逐行添加/编辑/清除,已注入的条目带徽标与内容预览。
  • 持久化:规则保存在 <DSH_HOME>/model-prompt-injector/config.json(默认 ~/.dsh/model-prompt-injector/config.json),重启 DSH 后自动恢复。
  • 即时生效:保存规则后,下一次模型请求即携带新提示词,无需重启。

安装(标准 DSH bundle)

dsh plugin --profile web add @duke-dsh-plugins/dsh-model-prompt-injector --registry=https://registry.npmjs.org

显式指定 npmjs registry,避免被本地/镜像 registry 配置带偏。安装后重启 DSH(Host 加载、typert 注册、client bundle 注入都在启动时发生),设置面板出现「模型提示词」页。

卸载:

dsh plugin --profile web remove @duke-dsh-plugins/dsh-model-prompt-injector

使用

  1. 打开 设置 → 模型提示词(在「模型」页之后)。
  2. 页面列出本地已配置的服务商卡片;每张卡片第一行是「所有模型(服务商级)」,其下是该服务商配置中的每个模型。
  3. 点击目标行的「添加提示词 / 编辑」,在文本框中编写要追加的系统提示词,保存即时生效;「清除规则」删除该条。
  4. 规则匹配是路由级精确匹配provider/model,大小写敏感,如 minimax-cn/MiniMax-M3);模型 id 以「模型」设置页中配置的值为准。

规则示例

| 规则 key | 作用范围 | | --- | --- | | deepseek-official/* | DeepSeek 官方路由的所有模型 | | minimax-cn/MiniMax-M3 | 仅 MiniMax-M3 | | zai-coding-cn/glm-5.3 | 仅 GLM-5.3 |

典型用法:给弱一些的模型追加一段严谨的工作协议(先验证再声称、最小改动、契约对齐……)以提升输出质量;给特定模型追加项目约定或输出格式要求。

实现要点

  • 注入基于 systemPrompt 服务的动态段落:段落文本是每次模型 step 组装时求值的函数,运行时组装上下文携带 agent,按宿主模型选择层的同一优先级解析本次请求的目标路由(UI 选择的模型 → 已记录请求头 → 创建时 options,DSH 0.1.5+ 下 agent.options 只是创建时快照)做规则匹配;未命中返回空串,渲染器自动丢弃空段落(零开销)。
  • 规则读写走插件自有的 Typert Remote 服务(modelPromptInjector.getState / setRule),Client 经 ctx.remote.$mount 自挂载命名空间后调用。

开发

npm run check   # node --check index.js client.js typert.host.js

本地调试安装(link:,插件目录需已有 node_modules,见 AGENTS.md):

npm install --no-save --registry=https://registry.npmjs.org @deepseek-ai/[email protected] @deepseek-ai/[email protected] [email protected]
dsh plugin --profile web add /path/to/dsh-model-prompt-injector
# 重启 DSH 生效

发布

v* 标签推送 GitHub,.github/workflows/release.yml 自动构建 tgz、发布 GitHub Release,并经 npm OIDC Trusted Publishing 发布到 npmjs(需在 npmjs.com 包设置中先配置 trusted publisher:本仓库 + .github/workflows/release.yml)。

License

MIT © duke