dsh-inject
Advanced model-context injection and request-only rewriting for DeepSeek Harness with Keysmith rules compatibility. dsh-inject:为 DeepSeek Harness 提供高级上下文注入与请求侧消息重写,兼容 Keysmith 规则集。
What it is
Advanced model-context injection and request-only rewriting for DeepSeek Harness with Keysmith rules compatibility. dsh-inject:为 DeepSeek Harness 提供高级上下文注入与请求侧消息重写,兼容 Keysmith 规则集。
How to install
Run this in the DSH web profile, then refresh the page.
$ dsh plugin --profile web add dsh-inject@0.2.3
DSH versions accepted
^0.2.1-rc.2
Author and traction
john-walks-slow · ★ 56 · Updated 2026-11-07
About this plugin
dsh-inject
简体中文 · English
dsh-inject 是一个透明、灵活的破甲插件:所有改动都只发生在发给模型的请求副本上,不写入会话记录、不改动宿主的任何文件,关掉即等于从未启用过。 三种注入手段:系统提示词注入(系统段)、构造回合伪造(system / 用户 / 助手 / 工具)、关键词与正则替换。 四种使用方式:挂在某个模式上(切换到该模式自动生效)、会话内随时 /inject on|off、标记为总是启用、按模型或 agent preset 限定——同一个插件可以让不同模型跑不同的预设。 现成预设:内置 unrestricted(Keysmith v0.6.0 交付契约)、nsfw、authority 三个预设;预设库里还能一键导入 dsh-purge 破甲稿与在线规则。
每次注入都会在会话里留下一条可折叠的记录行,写明这次注入了什么。
安装
从 git 安装拿到的是源码,包内的 prepare 会在安装时构建 lib/。如果 pnpm 拦下了构建脚本、导致安装失败,按 dsh 的提示把包键写进该 profile 的 pnpm-workspace.yaml 后重试:
建议锁定 commit 安装,后续推送就不会悄悄改变实际运行的代码:
安装后无需改配置:包内自带 dsh.bundle.patch,重启 dsh 即生效。 兼容性:面向 dsh 0.2.1-rc.2 及以上。宿主包全部走 peerDependencies(不随插件装进 profile),因此插件永远不会把旧版 dsh-tools / dsh-commands 之类带进 profile 顶掉宿主组件;在不兼容的 dsh 上,宿主会按 peer 检查跳过这个插件并给出提示,而不是让 dsh 起不来。 核心语义 只改请求,不改会话:自动替换发生在发给模型的请求副本上;会话记录和界面显示的原始消息保持不变。 默认关闭:预设一律不默认启用;需要常驻时在设置页勾选「默认启用」,或在本会话用 /inject 临时启用。 会话级覆盖:/inject / /inject off 只作用于当前会话,且总是优先于预设的「默认启用」。 agent preset 级默认启用:勾选「默认启用」后可在展开区填「限定 agent preset」(逗号分隔,留空=全部);填了之后只在该会话当前 agent preset 命中时默认启用。当前 preset 由 DSH 的 agentPreset 投影读取,运行中切换即刻按新 preset 重算。 模型级默认启用:展开区还可填「限定模型」(模型 id 或 provider/model,逗号分隔,留空=全部);只有当前请求的模型命中时该预设才自动启用。显式 /inject on 不受模型限制。 两条注入通道:系统段进入宿主的 system prompt(受 complete 模式影响);构造回合进入请求的消息列表。两者可同时启用,最终顺序是:宿主系统消息 → 构造回合(按你排的顺序)→ 原会话消息。排在最前的 system 回合由 provider 连同系统提示一起提升,排在对话之后的则成为对话中的 system 更新——位置不做搬运。 id 即句柄:预设只有 id 一个标识,不含空格、逗号与斜杠;设置页里 id 就是标题,可直接改。 零副作用:启用状态是进程内状态,不写入会话日志;关掉预设等于从未启用。 会话级状态在进程重启后重置(回到只剩「默认启用」预设的状态)。 配置(设置页 → Inject)
设置页可以建立任意多个预设,每个预设包含三部分:
1. 系统段:通过宿主的 systemPrompt.section 注入一段系统提示词,按当前会话、agent preset 与模型实时计算;留空不注入。 2. 自动替换:多条规则,每条可选「关键词」或「正则」,填写替换文本,并勾选生效角色:用户 / 助手 / 工具返回 / 工作区指令。 3. 开头构造回合:插在宿主系统消息之后、原会话消息之前的消息,角色可选 系统 / 助手 / 用户 / 工具。
另外可维护构造回合模板,供现场 dialog 与 /inject-turn 复用。
Similar plugins
EverOS
One portable memory layer for every AI agent: local-first, Markdown-native, user-owned, and self-evolving across apps, t…
billion-context
A context-compression plugin — small context windows (a 100K context is enough), 5x fewer tokens, month-long single sess…
dsh-context
A DeepSeek Harness plugin for context insight and management, with context dashboard and context command, for understand…