@vertixara/dsh-prompt-manager
Layered system-prompt profiles — global, per-workspace and per-session entries injected in order — where individual builtin sections and runtime contexts can be disabled or overridden, with a line-level diff of what an override changed; each entry carries a subagent scope that targets the main agent
Install
dsh plugin --profile web add @vertixara/dsh-prompt-manager
Sandbox test results
| Stage | Result |
|---|---|
| 1 install | ✓ |
| 2 list | ✓ |
| 3 mount | ✓ |
| 4 boot | — |
Four stages run in an isolated sandbox: install (network on) → list → mount → boot (last three with no network).
README
dsh-prompt-manager




本页中英逐段对照:每个中文段落后跟英文段。 This page pairs each Chinese paragraph with its English version.
DeepSeek Harness 的分层提示词管理器 —— 档案条目按「全局 / 工作区 / 会话」三级投放,内置段落与运行时上下文可以禁用或覆盖,每次改动都能看到逐行 diff。没有构建步骤,改完刷新页面。
A layered prompt manager for DeepSeek Harness — reusable prompt entries delivered at three levels (global / workspace / session), with built-in sections and runtime contexts you can disable or replace, and a line-level diff for every change. No build step: edit, refresh, done.
左侧是档案库,右侧是投放区:把条目拖进「全局」就是所有会话都带上,拖进某个工作区就只在那个目录生效。图底部那行是存储文件的实际位置。
On the left is the library, on the right the drop zone. Drag an entry into "global" and every session gets it; drag it into a workspace and only that directory does. The bottom line shows where the store file actually lives.
它解决的是这几件事:
- 想给所有会话固定加一段指令,但又不想动 DSH 源码或每次手动粘贴
- 想只在某个项目里关掉某条内置约定,别的地方保持原样
- 想知道这一轮真实的系统提示词长什么样 —— 包括子代理拿到的那一份
It solves three problems:
- Pin an instruction to every session without patching DSH or pasting it by hand
- Turn off one built-in convention in one project only, leaving everything else intact
- See what this turn's system prompt actually looks like — including the one a subagent receives
✨ 功能 · Features
- 三级投放 —— 一条条目可以只给当前工作区、只给某个会话,或者全局。工作区按归一化路径识别,换目录自动切换。
- 内置段落改写 —— Harness 和其他插件注册的 section 都能禁用或替换全文。列表是真实装配出来的,不是硬编码清单。
- 运行时上下文改写 ——
working-directory:current、sandbox:policy、team:identity这类每轮动态生成的 context 同样可禁用或覆盖。 - 逐行 diff —— 被覆盖的段落用行级 LCS 标出真正变化的行,未变段落折叠成「⋯ N 段未变」,同一行内再用公共前后缀剥离定位到具体那几个字。
- 父子智能体作用域 —— 条目可选「主+子代理 / 仅主代理 / 仅子代理」,判定依据是框架写入的
origin/parentSession/delegationDepth。 - 改动时机分两条路 —— 全局改完等下一个会话,会话页改完立即生效且只影响那一个会话。原因是提示词前缀缓存:前缀一动,整段缓存作废。
- 真实装配快照 —— 每轮记录
system-prompt/assemble的结果,可枚举 agent 作用域的段落和全部工具,是唯一能看到子代理提示词的地方。 - 工具 + HTTP 接口 —— 全部能力都能从
prompt_manager工具或/prompt-manager/api调用,Web 界面只是其中一层壳。
English:
- Three-level delivery — an entry can target the current workspace, a single session, or everything. Workspaces are keyed by normalized path, so switching directories switches the active set.
- Built-in section rewrite — any section registered by Harness or another plugin can be disabled or replaced wholesale. The list comes from real assembly, never a hardcoded inventory.
- Runtime context rewrite — per-turn contexts like
working-directory:current,sandbox:policy, andteam:identitycan be disabled or overridden too. - Line-level diff — overridden sections are compared with a line LCS so only genuinely changed lines are highlighted; unchanged runs collapse into "⋯ N lines unchanged", and within a changed line a common prefix/suffix strip narrows the highlight to the few characters that actually differ.
- Parent/child agent scope — entries can be marked "main + subagent / main only / subagent only", decided from the
origin/parentSession/delegationDepththe framework writes intoSessionHeader. - Two change timings, on purpose — global changes wait for the next session; session-page changes apply immediately and only to that one session. The reason is prompt prefix caching: move the prefix and the whole cache is invalidated.
- Real assembly snapshots — every turn records the result of
system-prompt/assemble, enumerating agent-scoped sections and all tools. It is the only place you can see a subagent's prompt. - Tool + HTTP API — everything is reachable through the
prompt_managertool or/prompt-manager/api. The Web UI is just a shell over that.
🚀 安装 · Installation
前置:DSH >= 0.2.1-rc.2,Node ^22.19.0 || >=24.0.0。
Requires DSH >= 0.2.1-rc.2 and Node ^22.19.0 || >=24.0.0.
安装 / Install:
dsh plugin --profile web add @vertixara/dsh-prompt-manager
本地源码(开发时)/ From source, while developing:
dsh plugin --profile web add link:D:\dsh-dev\plugins\dsh-prompt-manager dsh web
dsh plugin 是 pnpm 的转发器,但它多做一步关键动作:把包名写进 profile package.json 的 dsh.profile.bundles。那个列表才是启用开关 —— 包装上了但没进 bundles,DSH 不会加载它。
dsh plugin forwards to pnpm, but with one extra step that matters: it writes the package name into dsh.profile.bundles in the profile's package.json. That list is the enable switch. Install a package without adding it to bundles and DSH will never load it.
卸载与更新 / Uninstall and update:
dsh plugin --profile web remove @vertixara/dsh-prompt-manager dsh plugin --profile web update @vertixara/dsh-prompt-manager@latest
🎯 五分钟上手 · Quick start
1. 打开左侧边栏的提示词面板
2. 在「提示词档案」页签新建一条:填标题和正文
3. 右侧「全局」区块里把它的开关打开
4. 新开一个会话 —— 条目会出现在那个会话的系统提示词里,会话页签的「本会话生效条目」能看到它
English:
1. Open the Prompts panel in the left sidebar
2. Under the Prompt library tab, create an entry: title and body
3. Flip its switch in the Global block on the right
4. Start a new session — the entry is now in that session's system prompt, visible under Effective entries on the session tab
想临时试一段话不想留档?直接在会话页签里加临时条目,下一轮就注入,只影响这个会话。
Want a one-off without keeping it? Add a temporary entry from the session tab: it is injected on the next turn and affects that session only.
⏱️ 改动什么时候生效 · When changes take effect
这是这个插件最需要理解的一点。提示词是服务端的前缀缓存,前缀一变整段缓存就作废,所以规则故意分成两条路:
This is the one thing worth understanding about the plugin. Prompts are prefix-cached server-side: move the prefix and the entire cache is invalidated. So changes are deliberately split into
…(truncated)
Rendered from the README published on npm. Formatted only, not edited.
Versions
Published on npm::8,最后更新 2026-10-29