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-prompt-inject

v0.1.0

Published

System-prompt template injection for DeepSeek Harness: manage named prompt templates and inject the selected one (global default plus per-workspace overrides) into every session's system prompt.

Readme

dsh-prompt-inject

简体中文 | English

为 DeepSeek Harness Web 界面提供的系统提示词注入模板管理器。

npm license

在 设置 → 插件 → 提示词注入模板 中维护多套命名提示词模板,并把选中的模板注入到每个会话的系统提示词正文。支持一个全局默认模板 + 每个工作区独立选一套模板;选中即生效,无需单独开关,切换后下一条消息即生效。

功能

  • 🗂️ 多套命名模板:增、删、改、预览任意数量的提示词模板
  • 🌐 全局 + 按工作区:一个全局默认模板;每个工作区可独立选择「跟随全局 / 不注入 / 指定模板」
  • ⚡ 即时生效:变量在每次组装时求值,中途切换下一条消息即生效,新会话自动生效
  • 🧩 注入系统提示词正文:order 50(位于部署人设之后、工具指引之前)
  • 🌍 中英文双语:卡片文案跟随 Harness UI 语言(zh / en)
  • 🎨 深浅主题适配:UI 使用 Harness 主题 CSS 变量自动跟随明暗

安装

npx dsh-prompt-inject install

安装器会自动完成(幂等,可重复运行):

  1. 将包安装到 $DSH_HOME/profiles/node_modules/dsh-prompt-inject(dsh 插件解析根,真实目录)
  2. 将组合行写入 $DSH_HOME/profiles/<profile>/cordis.patch.yml

完成后重启 dsh 并刷新浏览器页面即可。重启是唯一需要手动完成的步骤——宿主模块与组合在进程内缓存,插件无法安全地重启自己的宿主进程。

从源码安装

git clone https://github.com/H1a3x/dsh-prompt-inject.git
cd dsh-prompt-inject
node scripts/install.js --from . --force

可选参数

| 参数 | 说明 | |------|------| | --profile <name> | 指定目标 profile(默认 web) | | --force | 覆盖已安装的包 | | --from <path> | 从指定目录安装(默认脚本所在包的根目录) |

使用

安装并重启后,打开 设置 → 插件 → 提示词注入模板:

  1. 点「添加模板」,输入名称与提示词正文
  2. 在「全局生效模板」下拉里选一个作为默认模板(未在下方覆盖的工作区使用它)
  3. 在「按工作区覆盖」里给某个工作区单独选一套模板,或选「不注入」
  4. 每个模板行有「预览」按钮,可随时查看正文

选中即生效——无需单独的开关。切换后下一条消息即注入新模板,新会话自动生效。

工作区匹配以 host 侧 realpath 规范化后的路径为键,与 agent 会话的 cwd 同源,因此一一对应。

工作原理

lib/index.js       宿主半:settings 命名空间 + systemPrompt 变量/段 + /prompt-inject 路由
lib/client.js      浏览器半:设置页卡片(shell module-table 格式,无构建步骤)
scripts/install.js 一键安装器

注入通过 systemPrompt.variable() + systemPrompt.section() 实现:段文本固定为 {{dsh_prompt_inject_text}},变量 provider 在每次组装时读取当前 settings 与 agent 的工作区,返回该工作区应注入的模板文本。

插件装载契约:

  • package.json 声明 dsh.client.platform = "web" 及 inject 依赖,宿主扫描器据此生成 window.__DSH_BOOT__ 图行并挂载 /plugins/<id>/client.js 路由
  • 浏览器半以模块表格式打包,工厂返回 { apply, inject }
  • UI 入口通过 ctx.slots.inject('settings.plugin.item', …) 注入到设置 → 插件 配置段
  • 热更新边界:lib/client.js 内容变化刷新页面即生效;dsh.client 声明变化需要重启 dsh

卸载

删除 $DSH_HOME/profiles/node_modules/dsh-prompt-inject 目录,并从 cordis.patch.yml 移除以下行,然后重启 dsh:

- insert:
    - id: prompt-inject
      name: dsh-prompt-inject

也可以保留组合行,在 Harness 设置页的插件清单里禁用本插件。

开发

npm run check           # 语法检查
npm run install:local   # 本地安装验证

许可证

MIT © H1a3x

友情链接