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-extra-context

v0.1.6

Published

给当前 DSH 的全部会话与子代理统一附加一段额外说明和上下文:设置页分段维护、实时预览、热生效。

Readme

dsh-extra-context

给当前 DeepSeek Harness 的所有对话(主会话、子代理、workflow 子步骤)统一附加一段额外说明和上下文。文本在设置页分段维护、实时预览、热生效。

它解决什么问题

有些东西需要在每一次对话里都成立:回答语言与风格、跨项目的约定、你的身份与偏好、必须一直遵守的边界。把这些写进 AGENTS.md 会混进项目级指令;在每个会话里重复粘贴又容易漏。这个插件把一段文本放进 system prompt 的固定位置,对所有会话自动生效。

功能

  • 全局生效:注册为进程级 system prompt section(deployment:extra-context,order 204),位于人格段之后、官方工具说明之前。主会话、子代理、workflow 子步骤都会带上,不依赖具体 agent preset。
  • 多条上下文:每条可单独用开关启停;停用或内容为空的不出现在提示词里。列表默认收起,点某一条展开编辑。右上角的「总开关」一次关掉整段上下文。
  • 无需保存:输入时不受打扰,离开输入框即写入;总开关、每行的启停开关与增删都是点了即生效。
  • 设置页实时编辑:设置 → 额外上下文。文本写入 $DSH_HOME/settings.yaml 的 extra-context: 段,热生效,不需要重启。左侧菜单这一行有自己的图标(IconContextInjectionOutline16),不会和「设置」本身的齿轮撞脸。
  • 常显预览与消耗:预览区只有两块——最终会附加到对话里的完整文本,以及它的体积与大致 token 量;内容偏长时给出一句精简建议。它写在每次对话最前面、优先于其他说明,这一点写在页面标题下方的说明里。
  • 长会话被压缩后照样生效:会话过长时 DSH 会自动压缩,用一次单独的模型调用把历史写成摘要。那次调用的写作要求固定是英文,摘要于是变成英文,压缩之后的对话基调也跟着跑偏(过程性回复改用英文,最终答复仍是中文)。本插件会在那次调用末尾附上一条「以用户的额外上下文为准」的指令,摘要继续按你要求的语言书写。
  • 降级可用:部署里没有 settings 服务时,插件仍按组合层配置生效(仅当前进程),并在设置页给出提示。

什么时候生效(重要)

system prompt 在会话启动时组装并固化,之后的改动不会追进已开始的会话:

| 场景 | 行为 | |---|---| | 修改上下文后新建的会话 | 立即使用新版本 | | 修改上下文前已经开始的会话 | 继续使用启动时的旧文本,直到该会话结束 | | 想用上最新内容 | 新开一个对话 |

设置页顶部有同样的说明,不会让你以为「改完了但没生效」。

和其它机制的分工

| 机制 | 适合放什么 | |---|---| | 本插件 | 跨工作区的长期偏好、全局约束、希望一直遵守的约定 | | $DSH_HOME/AGENTS.md | 你所有工作区的通用工作指导(DSH 原生能力) | | 项目内 AGENTS.md | 某个项目/目录的构建命令、代码规范 |

同一段话不要在两处维护:重复内容既占上下文,也会在你的两个来源冲突时让模型无所适从。

安装与卸载

dsh plugin --profile web add dsh-extra-context        # 安装
dsh plugin --profile web add [email protected]  # 升级到指定版本
dsh plugin --profile web remove dsh-extra-context     # 卸载

已发布为 dsh-extra-context。profile 依赖是 caret 范围,升级需要显式写版本号。

首次安装必须重启 dsh web:新增插件会改变 profile 的 bundle 列表,而 bundle 列表只在启动时读取(patchReload 只热重载 patch 文件)。在 Warp 里 Ctrl+C 后重新执行 dsh web --no-open,然后刷新页面。

从源码运行:./install.sh 会先做兼容性与打包检查,再通过官方 profile manager 挂载 link:<源码目录>;./uninstall.sh 移除(同样需要重启 dsh web 才彻底生效)。卸载只移除 profile 依赖与 bundle 层;规则存在 profile 配置里 dsh-extra-context 这一行的 config 段,卸载不会删除它。

要求:DeepSeek Harness Web >=0.1.7-alpha.1 <0.1.8(0.1.7-alpha.1 已逐版本核对),Node.js 20 或更高。范围外保持 inert。

使用

  1. 打开 设置 → 额外上下文,确认右上角的「总开关」处于开启(关闭时整段上下文都不进入提示词)。
  2. 点 + 添加上下文,在展开的文本框里写入内容(没有保存按钮:输入时不受打扰,离开输入框即写入)。
  3. 每条左侧的开关、删除与展开都是点了即生效。
  4. 设置页的预览区始终显示最终会附加进去的文本。改动对新开的对话生效;已经开始的对话继续用启动时的文本。

限制与注意事项

  • 这段文本出现在每一次模型请求里,会持续占用上下文:请精简,并留意预览里的消耗提示与偏长提醒。
  • 如果某个 agent preset 注册了同名 section(deployment:extra-context),会按 DSH 的遮蔽规则覆盖本插件的文本;本插件自身不注册任何 agent 级 section。
  • 压缩摘要的语言跟随你的额外上下文:想让它保持英文,把额外上下文里的语言要求去掉即可。这条钩子只作用在「压缩摘要」这一次模型调用上,不改写 DSH 自己的指令,也不会往会话里插消息。
  • 插件不会写入或修改 DSH 源码、不会改动 profile 的用户 patch 层,全部副作用都是可逆的。

技术细节(契约、机制、排查)见 AGENTS.md。

License

MIT