rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:irislilymoon/dsh-prompt-studio
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
DSH 桌面端 / Web 端插件,用来编辑初始系统提示词,并按需撤掉 DSH 注入的 runtime 上下文、工具 schema、AGENTS.md、时间读数等系统侧输入。普通模式、仅聊天和自定义模式可以在输入框上方切换;仅聊天支持记忆,以及按单项放行或屏蔽。新对话使用设置页选定的默认模式。
本项目是独立实现,额外提供自定义模式、新对话默认模式、旧系统提示词重建、原生主题 UI、细粒度屏蔽和与输入框对齐的模式选择器。
SOUL.md / MEMORY.md,让模型用 read / write / edit 创建和更新它们;按工作区隔离。Menu / Button / SegmentedControl 和浅色/深色主题服务,Web 与 Desktop 共用同一套实现。设置页的「新对话默认模式」决定新会话的初始模式;已有对话可以在输入框上方单独切换。
| 模式 | 行为 |
|---|---|
| 普通模式 | 完全使用 DSH 自带的系统提示词与完整工具 |
| 仅聊天 | 只发送「仅聊天提示词」,默认全量替换并屏蔽所有系统侧输入;可在「仅聊天屏蔽与记忆」里放行记忆、时间或个别工具 |
| 自定义模式 | 使用模式自己保存的提示词、屏蔽总开关、单项 allow/deny、记忆和工具保护配置 |
本版本没有全局模式。设置页编辑的是仅聊天提示词与它自己的屏蔽/记忆配置;普通模式固定使用 DSH 默认提示词,其他组合通过自定义模式保存。
「仅聊天」固定使用设置页里的「仅聊天提示词」,并默认打开四类屏蔽:
read / write / edit。agent-instructions、time-context、skill-catalog、skill-invocation。展开单项后可以只保留时间读数等某一项。设置页的「仅聊天屏蔽与记忆」只作用于仅聊天模式:
打开「允许记忆」后,插件会在当前会话所属工作区的根目录读取两个文件,并在每轮装配时注入系统提示词。设置页会显示当前解析到的「记忆目录」,展开「记忆文件」还能直接看到并编辑这两份文件的内容;SOUL.md 与 MEMORY.md 各有独立勾选,只勾选的会被注入(对应「记忆文件 N/2」计数)。
SOUL.md:人格、语气、价值观和边界。文件不存在时,只在你明确要求设置人格时才建议模型创建。MEMORY.md:跨对话保留的用户偏好、项目背景和决定。文件不存在时,模型可以在学到耐久事实后自行创建。{{变量}} 插值;单文件最多注入 12000 字符,超出会截断并提示模型用 read 查看全文。与 QQ 工作区内容各自独立:QQ 机器人工作区(im-qqbot.config.cwd)里的 SOUL.md / MEMORY.md 归 dsh-qq-workspace 插件管理,本插件不读写那两个文件;属于该工作区的会话在设置页会显示「由 QQ 工作区插件单独管理」。两边各自维护各自的文件内容,只有记忆开关(见下)是联动的。
与 QQ 工作区同步开关:这里「允许记忆」是全局开关,保存后会同步到 dsh-qq-workspace——这边打开或关闭会同步打开/关闭它的两个文件;反过来,QQ 那边单独打开某个文件也会打开这边,但 QQ 那边关闭不会动这里(它只管它自己工作区的会话)。
同时默认放行这些工具/注入(带「记忆默认」标记,仍可在单项里勾选屏蔽,但记忆可能失效):
read、write、edit、str_replace_editor。time-context(当前时间与间隔读数)。working-directory:current(仅当 runtime 总开关打开时;projection 只保留工作目录这一节)。注入前会替换已有的同名记忆段,最终只保留一份,不会重复注入;安全锁、审批和工作区路径校验仍然生效。
记忆按工作目录隔离:不同工作区的 MEMORY.md 相互独立。想要一份跨项目共享的记忆,可以固定使用同一个工作区聊天。
普通模式不使用这里的记忆开关,始终是 DSH 默认提示词 + 完整工具。想要“默认提示词 + 完整工具 + 记忆”,新建一个自定义模式,提示词模式选「不覆盖」,再打开记忆即可。
仅聊天默认从第一条消息起就不带工具,所以「你好」这一轮也是低 token。打开记忆后工具列表不再为空,这一轮会带上被放行的几个工具 schema。
设置页的「自定义模式」板块可以新建、编辑、删除模式。每套模式独立配置:
harness:identity 和 deployment:persona-prefix,其他段保留。{{变量}} 插值;只有 {{model}} 会被替换成当前模型名。新建模式默认使用「全量替换」,并把当前仅聊天提示词作为起点,屏蔽总开关和记忆默认关闭,可以按需调整。
切换当前对话的模式后,下一轮 agent/pre-step 会返回 startsRequestSeries: true,DSH 随即将当前激活的 system 节点替换为新模式的系统提示词,并清空后续旧节点。例如从仅聊天切到普通模式,新一轮会重新注入 DSH 的普通系统提示词,而不是继续沿用历史里的仅聊天提示词。
system-prompt/assemble,重写 sections,并按工具名过滤 tools。SOUL.md / MEMORY.md,注入对应的 soul / memory 段;符号链接、越界文件、非普通文件和超过 1MB 的文件拒绝读取。注入前会替换已有的同名记忆段,与 dsh-qq-workspace 共用同一段名,因此只会出现一份。agent/pre-step,按 source.kind 和 allow/deny 过滤 messages。agent/pre-step 设置 startsRequestSeries: true,由 DSH 用当前模式的提示词覆盖旧节点。agent.runtimeContext.project,按 context 名(如 working-directory:current、sandbox:policy)过滤快照后重新拼接;仅在投影无法包装时回退到 systemPrompt.suppressRuntimeContext()。<DSH_HOME>/prompt-studio/settings.json(默认 ~/.dsh/prompt-studio/settings.json),原子写入。自定义模式的会话引用格式为 custom:<id>。Menu / Button / SegmentedControl 与宿主 theme 服务;单项列表使用原生复选框,Web 和 Desktop 共用。dsh-prompt-studio/
├── index.js # 宿主半侧:装配重写、注入过滤、HTTP 路由
├── client.js # 浏览器半侧:设置页、输入区模式选择器
├── cordis.patch.yml # bundle patch
├── package.json
├── locale/ # 插件市场显示用的中文/英文元数据
│ ├── zh.json
│ └── en.json
├── icon.svg
├── test/ # 抑制、记忆放行与 runtime 投影的单元测试
│ └── suppress.test.mjs
├── README.md
├── CHANGELOG.md
└── LICENSE
npm test
测试只使用 Node 内置模块和临时目录,不需要安装依赖,也不会读写真实配置。
将本目录放到任意位置,然后在 DSH 中打开:
设置 → 插件 → 添加插件 → 填写该目录的绝对路径:
<插件目录>\dsh-prompt-studio
安装后插件会出现在「已安装插件」,确认开关是开启状态即可;客户端部分会热更新,宿主部分按提示重启 DSH。
卸载:设置 → 插件 → 系统提示词工作室 → 卸载。
桌面 profile 由 Electron 应用独占管理,dsh plugin --profile desktop ... 会被拒绝。桌面端请使用上面的插件页;Web / CLI profile 可以用:
dsh plugin --profile <profile-name> add "<插件目录>/dsh-prompt-studio"
complete: true 的系统提示词段(DSH 内置 minimal 模式会),平台会在装配最后把它恢复为唯一段,本插件的提示词段无法进入。请改用 standard / cordis / ptc 等模式。SOUL.md / MEMORY.md 位于当前会话所属工作区的根目录(与 dsh-qq-workspace 共用同一份文件);没有工作目录的会话无法注入记忆。记忆按工作区隔离,每轮注入会消耗 Token,不要放密钥、密码或身份证件。只读会话仍然不能写入。SOUL.md / MEMORY.md 会进入系统提示。打开不受信任的仓库前先确认这两个文件的内容;注入段会把它们当作背景数据而不是指令,但不能完全消除持久化提示注入的风险。read / write / edit、time-context、working-directory:current 默认放行;它们现在可以在单项里勾选屏蔽,但屏蔽后记忆可能无法读写或定位文件。role === 'user' 的注入消息;assistant / tool 历史原样保留,避免破坏会话结构。Menu / Button / SegmentedControl 客户端 primitives 与 theme 服务的 DSH 0.2.x;桌面端与 Web 端使用同一套宿主接口。~/.dsh/prompt-studio/settings.json
prompt.text: 仅聊天提示词正文suppress: 仅聊天四类屏蔽总开关(runtime / tools / injected / all)allow / deny: 仅聊天的单项例外与单独屏蔽列表,每类都是字符串数组memory: 仅聊天是否开启记忆最小放行toolSafety: 仅聊天的工具基线保护defaultMode: 新对话默认模式,normal / pure / custom:<id>modes: 自定义模式数组,每项包含 id、name、promptMode、promptText、suppress、allow、deny、memory、toolSafetysessions: 每个会话的模式覆盖;没有覆盖的会话跟随 defaultModeallow / deny 为空,memory 关闭SOUL.md 和 MEMORY.md删除该文件即可恢复默认(插件仍会挂载,但所有功能关闭)。
<DSH_HOME>/prompt-studio/settings.json;设置页通过同源本地路由存取,不访问外部服务。A DSH Desktop/Web plugin that makes the initial system prompt editable and suppresses runtime context, tool schemas, AGENTS.md, time readings and other system-side input. Chat only also supports memory and per-item allow/deny. Normal mode, chat only and custom modes switch from the prompt row above the composer; new chats use the default mode chosen in Settings.
This is an independent implementation. It adds custom modes, a default mode for new chats, clean replacement of stale system prompts, native theme-aware UI, granular suppression, memory-friendly allowances, and a composer-aligned mode selector.
SOUL.md / MEMORY.md from the workspace root, shared with dsh-qq-workspace (one file, one section, one copy in the prompt). Chat only allows read / write / edit / str_replace_editor, time-context and the working directory by default; the model can create missing files with write. Same memory sections already present in the assembly are replaced before injection. Memory does not bypass the safety lock, approvals or workspace path checks. Normal mode ignores the memory switch; use a custom mode with “do not override” and memory on for the default prompt plus full tools and memory.Menu, Button, SegmentedControl and the host light/dark theme service; the same client runs on Web and Desktop.Prompt modes available inside a custom mode are do not override, replace whole prompt, and replace opener only. {{model}} is replaced with the current model name; other text is injected literally. New custom modes start from the chat-only prompt with full replacement and no suppression enabled.
Settings v2 files upgrade to v3 on read; chat only keeps suppressing all four categories, with empty allow/deny lists and memory off. Data lives in ~/.dsh/prompt-studio/settings.json. Install from Settings → Plugins → Add plugin with the absolute path to this directory (the desktop profile is managed by the Electron app; dsh plugin --profile desktop ... is refused). Web/CLI profiles can use dsh plugin --profile <profile-name> add "<plugin-dir>/dsh-prompt-studio".
Limitations: minimal agent presets with a complete prompt section override this plugin's prompt; sessions that already used tools may reject a later empty tool baseline; each mode/prompt/memory change rebuilds the KV cache once. Memory files live in the session working directory and are per workspace; a session without a working directory cannot inject memory. The plugin only filters user-role injected messages and leaves assistant/tool history intact. DSH 0.2.x with client primitives and the theme service is required.
Privacy: all settings stay local in ~/.dsh/prompt-studio/settings.json. The plugin has no telemetry and makes no external network calls; the repository ships no user settings, session logs, credentials, account data, or machine-specific paths.
MIT — see LICENSE.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。