把你保存的上下文条目以「Remember」行的形式注入到每条用户消息之后,可按轮或按会话一次;带设置编辑器与管理页。
安装
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:polohot/dsh-adrian-inject-context
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
Inject Context for DeepSeek Harness (DSH): persist your own context entries and have them injected as a standalone Remember: row — right after your message — on every turn or once per session, per entry.
Features
- Standalone sourced row — never touches the initial system prompt or the shared runtime-context snapshot
- Simple / Advanced datasets — two independent context lists; the active mode's dataset is what gets injected (exclusive)
- Per-entry checkboxes — toggle any entry on/off, applies from the next request
- Per-entry frequency (v0.3.0) — each entry has an Every turn switch: ticked (default) the entry is injected right after every message; unticked it is injected only at the start of a session and never again — restart-safe, detected from the session's persisted sourced-message surface plus in-memory per-session tracking
- Native Settings UI — Settings → Inject Context: add, edit, delete, toggle, save
- Persistent — datasets and active mode survive sessions and restarts
- Standalone manager page — also available at
/adrian-inject-context
Screenshots
Settings → Inject Context — manage your datasets

Remember: row in the Trajectory

Install
dsh plugin --profile web add polohot/dsh-adrian-inject-context
Usage
- Open Settings → Inject Context
- Add context entries; per row, two switches:
- Enabled — off = never injected
- Every turn (ticked by default) — ticked = injected right after every message; unticked = only the first message of a session
- Pick the active tab (Simple/Advanced) — its dataset feeds the injection
- Send any message and check the Trajectory: your message sits above the
Remember:block (order: SYSTEM → your message →Remember:)
Per-entry frequency (v0.3.0)
| Enabled | Every turn | Behavior |
|---|---|---|
| off | — | never injected |
| on | ticked | injected right after every message of every session (the default, and the migration default for existing entries) |
| on | unticked | injected only at the start of a session (its first turn), never again in that session |
Once-per-session entries are restart-safe: a process restart never re-injects a once-entry into a session that already carries it. Prior injection is detected from the session's persisted sourced-message surface (the adrian-inject-context:lessons rows) plus in-memory per-session tracking while the process lives. Unticking an entry mid-session lets it appear on the next message exactly once more, then never again — per dataset, so Simple and Advanced stay fully independent.
Configuration
Store: ~/.dsh/adrian-inject-context.json (schema v2, auto-migrated from v1):
{
"version": 2,
"mode": "simple",
"simple": { "lessons": [{ "id": 1, "text": "…", "enabled": true, "everyTurn": true }] },
"advanced": { "lessons": [] }
}
everyTurn was added in v0.3.0 without a schema bump — entries missing the field default to true (the previous every-turn behavior).
Requirements
- DeepSeek Harness
dsh≥ 0.2.0-rc.2 (tested on the web profile) - Not compatible with
dsh0.1.x — see Session format v4 below
How it works
Host-side: an agent/pre-step waterfall listener composes the block per step — all enabled every-turn entries plus enabled once-entries not yet delivered to that session — and splices the plugin's own independently-sourced user-role message right after the turn's user message (the same pattern as dsh-agent-instructions), freshly read from the store on every step. It never injects into an empty entering batch (the agent loop's turn-close signal). Client-side: a settings-section module renders the manager against two host routes. Zero system-prompt modification.
Session format v4 (v0.4.0)
DSH 0.2.0 ships Session format v4, which retired the catch-all
{ kind: 'plugin', plugin: '…' } message source. That kind is now refused at
admission: emitting it raises SessionFormatError and aborts the whole turn
with format v4 message requires a producer-owned source kind.
This plugin emits the v4 producer-owned form of its own identity:
source: { kind: 'plugin:adrian-inject-context:lessons' }
That is the same kind the shipped v3→v4 migration derives for a third-party plugin, so live rows and rows migrated from older sessions share one identity and the once-per-session surface scan recognises both.
The row's position is decided by a positive test — a user-role row counts as
the turn's message only when source.kind === 'user'. Every other producer (the
runtime-context snapshot, agent instructions, tool and model rows) declares its
own kind and is skipped. v0.3.2 blocklisted the kinds it knew about, so the
runtime-context snapshot was mistaken for the user message and the row landed
after the snapshot instead of after the message it answers.
License
MIT
链接
同类插件
kingcharleslzy-ai/dsh-purge★ 3067
独立维护的 dsh-purge 社区分支,提供宿主策略补丁、提示词与规则设置、诊断、独立的更新检查与安装控制,以及本机备份回滚。
techflag/workdsh#enterprise-connection★ 274
面向 WorkDSH Desktop 2.0.6-alpha.3 及以上版本的企业连接插件,配合 WorkDSH Admin 提供成员登录、@同事分享正文与文件、业务插件认证复用,通过发行包安装。
ECNU/EduWork#dsh-oidc★ 250
可配置的 OIDC 登录与令牌授权模型接入,支持 LiteLLM 和显式启用的 oidc-llm 集成,提供独立 DSH Web 后端。
Yuuyuko-uu/dsh-feiyu-mood★ 159
给 AI 伙伴一个每轮判定、以一小段上下文提示的心情,面板里能看心情值、情绪维度与时间线。
accomplish07zrh-eng/dsh-aurabot-qq★ 81
通过 SnowLuma(OneBot v11)让 agent 以人设角色住进 QQ:私聊与群聊、语音条、表情包、QQ 空间日记、刷 B 站、翻唱、生图、长期记忆与心情。每项本事都是模块,可关闭、替换或在本地扩展——热重载的扩展模块还能改写群聊回不回、提示词、最终发出的消息和每个聊天用的模型。默认安全(总开关关、试运行开)。
huaizhuanghub/dsh-persona-dafeiyu★ 64
把选中的人设注入系统提示词的 DeepSeek Harness 插件:内置三套人设,支持从文件导入或粘贴自定义人设,并可按 profile 全局生效或按会话单独选择(输入框上方有切换条)。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。