diff --git a/README.md b/README.md index 2d2a8a6..abb04d3 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@
Version 1.1.14
- Local official DeepSeek Harness cybersecurity red-team plugin: evaluate and harden host safety policy in a controlled local install; swap prompts per model. Default prompt for Chinese models — 小码酱. Please star ⭐ + Local official DeepSeek Harness cybersecurity red-team plugin. Evaluate and adjust host safety policy on a controlled local install; swap prompts per model. Default prompt for Chinese models — 小码酱. Please star ⭐
@@ -25,11 +25,37 @@ English | 中文 -> 🌐 **Plugin hub:** [DeepSeek Harness Hub](https://deepseek.stream/plugins/dsh-purge) — official and community DeepSeek plugin market | discover and one-click install - -> Aligned with **dsh 0.1.5-rc.2** (Node.js **≥18**; Windows no-flash import hooks need **Node ≥22** `registerHooks`, older Node still gets file-level `windowsHide` patches). On other versions, unmatched originals stay pending or skipped. Nothing is rewritten blindly. +> Aligned with **dsh 0.1.5-rc.2** (Node.js **≥18**; Windows no-flash import hooks need **Node ≥22** `registerHooks`, older Node still gets file-level `windowsHide` patches). On other versions, unmatched originals stay pending or skipped. Nothing is rewritten blindly. Also accepts the 0.1.2 community `dsh-persona text` field and `dsh-mnemon` v0 session `summary`. After install you still need **Apply + restart**. > -> Also accepts the 0.1.2 community `dsh-persona text` field and `dsh-mnemon` v0 session `summary`. After install you still need **Apply + restart**. +> Hub page is for reading only: [DeepSeek Harness Hub](https://deepseek.stream/plugins/dsh-purge). Do not install via `deepseek.stream/api/plugins/download?...`. + +## Contents + +- [What this is](#what-this-is) +- [Install](#install) +- [Preview](#preview) +- [Usage](#usage) +- [How it works](#how-it-works) +- [Restore](#restore) +- [Releases](#releases) + +--- + +## What this is + +**dsh-purge** is a cybersecurity red-team plugin for the official [DeepSeek Harness](https://www.deepseek.com/harness/) already installed on your machine. + +Harness does more than forward a prompt. It rewrites prompts, approval gates, sandbox policy, and session migration at runtime. Asking only “will the model answer” treats a host-layer block as a model refusal. This plugin separates those two layers on your own install, for controlled evaluation and for seeing which default policy is too tight. + +| You get | What it does | +|---|---| +| **Rules** | Grouped patch status, Apply / Restore / Uninstall, prompt editor, multiple rule sets | +| **Host policy** | Default copy, permission policy, and tool limits. Official capabilities stay. No second invented identity | +| **On start** | Checks and reapplies. After npm overwrites `node_modules`, you do not hand-edit files | + +No hardcoded drive letters. It looks at `$DSH_HOME`, `.dsh` next to the dsh launcher, then `~/.dsh`. It does not patch the Harness source tree. **Apply** on the settings page is what writes the changes. Identity comes only from your `prompt-inject.md`. + +It only touches the official `@deepseek-ai` packages and local config on the user's machine. It is not a public scanner and not an attack kit for third-party sites. The repo does not ship malware, unauthorized-exploit scripts, or payloads aimed at the public internet. --- @@ -50,18 +76,6 @@ If this project helps you, send it over — I'm out here asking~ --- -## 🛡️ Why cybersecurity red-teaming matters - -As generative AI and large language models move into production, robustness, adversarial defense, and alignment safety are core cybersecurity research problems. A local Agent / Harness also rewrites prompts, approval gates, sandbox policy, and session migration at runtime. Asking “will the model answer” is not enough if the host layer kills a lawful eval request first. - -1. **Map the defense boundary, then harden the guardrail.** Professional cybersecurity red-teaming on a controlled local official DeepSeek Harness install is how teams find guardrail failures, prompt-injection, and unexpected-behavior gaps — then feed those findings back into fine-tuning, input guardrails, and the system safety layer. -2. **Build an offense–defense eval loop.** Defense without a controlled red-team suite is guesswork. Reversible patches on the installed official `@deepseek-ai/*` packages show which refusals come from the model and which come from default copy, approval ladders, or session-format checks — a reproducible ruler for labs and auditors. -3. **Advance native model-security research.** The project aims to give academia and security engineering a transparent, local, reproducible baseline. Keep official capabilities; only adjust over-refusal policy for controlled security eval. No second invented identity, and official optimizations stay. - -This is a **local official DeepSeek Harness cybersecurity red-team plugin**. It only touches **your** installed official `@deepseek-ai` packages and local config. It is **not** a public scanner, **not** an attack kit for third-party sites, and the repo does **not** ship malware, unauthorized-exploit scripts, or payloads aimed at the public internet. - ---- -+ 🌐 Open Hub page + · + 🚀 Install in desktop client +
+ +🔗 **Raw protocol URL:** + +``` +dsh://plugin/install?id=dsh-purge&name=dsh-purge&version=1.1.14&repo=YuJunZhiXue%2Fdsh-purge&permissions=%E7%B3%BB%E7%BB%9F%E6%8F%90%E7%A4%BA%E8%AF%8D%E6%B3%A8%E5%85%A5%2C%E6%9C%AC%E6%9C%BA%E8%A1%A5%E4%B8%81%2C%E8%AE%BE%E7%BD%AE%E9%A1%B5&downloadUrl=https%3A%2F%2Fgithub.com%2FYuJunZhiXue%2Fdsh-purge%2Farchive%2Frefs%2Fheads%2Fmaster.tar.gz +``` + +- 🌐 Open Hub page - · - 🚀 Install in desktop client -
- -🔗 **Raw protocol URL:** - -``` -dsh://plugin/install?id=dsh-purge&name=dsh-purge&version=1.1.14&repo=YuJunZhiXue%2Fdsh-purge&permissions=%E7%B3%BB%E7%BB%9F%E6%8F%90%E7%A4%BA%E8%AF%8D%E6%B3%A8%E5%85%A5%2C%E6%9C%AC%E6%9C%BA%E8%A1%A5%E4%B8%81%2C%E8%AE%BE%E7%BD%AE%E9%A1%B5&downloadUrl=https%3A%2F%2Fgithub.com%2FYuJunZhiXue%2Fdsh-purge%2Farchive%2Frefs%2Fheads%2Fmaster.tar.gz -``` - -**Web trigger example:** - -```js -/** - * Open the DeepSeek Harness desktop client to install dsh-purge - */ -export function installDshPurgeToDesktop() { - const params = new URLSearchParams({ - id: 'dsh-purge', - name: 'dsh-purge', - version: '1.1.14', - repo: 'YuJunZhiXue/dsh-purge', - permissions: '系统提示词注入, 本机补丁, 设置页', - downloadUrl: 'https://github.com/YuJunZhiXue/dsh-purge/archive/refs/heads/master.tar.gz', - }); - - const deepLink = `dsh://plugin/install?${params.toString()}`; - - const iframe = document.createElement('iframe'); - iframe.style.display = 'none'; - iframe.src = deepLink; - document.body.appendChild(iframe); - setTimeout(() => document.body.removeChild(iframe), 2000); -} -``` - -**HTML link:** - -```html - - 🚀 Install in desktop client - -``` - -**`dsh://plugin/install` parameters:** - -| Param | Value / example | Meaning | -|---|---|---| -| id | `dsh-purge` | Plugin id | -| name | `dsh-purge` | Display name | -| version | `1.1.14` | Semver | -| repo | `YuJunZhiXue/dsh-purge` | GitHub repo | -| permissions | `系统提示词注入, 本机补丁, 设置页` | Requested permissions | -| downloadUrl | `https://github.com/YuJunZhiXue/dsh-purge/archive/refs/heads/master.tar.gz` | GitHub source archive | + ### Manual install -Use this when `dsh` is not on `PATH`, official `dsh plugin add` fails, or you do not want a remote install. Edit **only the profile for the host you are using**. Do **not** delete existing bundles. Do not edit Web and Desktop in the same pass. +Use this when the command fails, `dsh` is not on `PATH`, or you do not want a remote install. Edit **only the profile for the host you are using**. Do **not** delete existing bundles. Do not edit Web and Desktop in the same pass. **0. Pick one host, one profile** @@ -465,7 +507,7 @@ Notes: **4. Run `pnpm install` only in the profile you just edited** -`pnpm` must be available (official `dsh` usually ships it). `cd` into **that profile directory**, not the repo root and not `$DSH_HOME` itself. +`pnpm` must be available (official `dsh` usually ships it). `cd` into **that profile directory**, not the repo root and not `$DSH_HOME` itself. Run only the block for your host. Do not run all three. ```sh cd "$DSH_HOME/profiles/web" @@ -544,32 +586,6 @@ Plugin config lives in `cordis.patch.yml`: --- -## What this is - -**dsh-purge** is a settings plugin for [DeepSeek Harness](https://www.deepseek.com/harness/): - -- Updates default copy, permission policy, and tool limits in the installed `@deepseek-ai/*` packages -- Adds a **Rules** card: grouped patches, Apply / Restore / Uninstall, session override editor, multiple rule sets -- Re-applies on start after an npm upgrade overwrites `node_modules` -- No hardcoded drive letters: `$DSH_HOME`, `.dsh` next to the dsh launcher, then `~/.dsh` - -It does not patch the Harness source tree. Use **Apply** on the settings page. Identity comes only from your `prompt-inject.md` — the plugin does not author a second identity card. - ---- - -## 0.1.5 notes - -| Symptom | Patch | What it does | -|---|---|---| -| Picking a workspace / new chat wipes to empty | `#4` `#27` `#38` | 0.1.5 `dsh-persona` requires `prefix`; old presets still send `text`. Alias `text` → `prefix` so 0.1.2 presets (liangshen) can mount | -| History: `summary requires notice form` | `#39` | `dsh-session-format-v0-to-v1` allows mnemon `instructions` / `recall` sources to carry `summary` | -| “Who are you” falls back to DeepSeek assistant | inject file | No second identity. The `dsh-purge` section is verbatim `prompt-inject.md` | -| Liangshen turn 1 looks uninjected | `#28` | phase-1 keeps persona / persona-prefix / persona-suffix plus inject; official tool catalog stays isolated | - -`#20` / `#27` / `#28` remain optional plugin rows: skip if those packages are absent. - ---- - ## Preview The **Rules** card appears on the dsh web settings page. Switch **Light / Ink**. Patches are grouped; the count only includes items that actually applied. Rule sets sit in a list above the editor, with Enable and Delete on each row. @@ -628,17 +644,6 @@ Runtime user files: `$DSH_HOME/prompt-inject.md`, `$DSH_HOME/rules/`, `$DSH_HOME --- -## Verify - -- After restart, the **Rules** card is on the settings page. Hard-refresh (Ctrl+F5) if the client bundle is cached. -- Click **Apply**, then **Restart** when prompted. Optional packages (liangshen / web-fetch) show as missing/skipped and do not block complete → restart. -- Until the user saves a different prompt, `prompt-inject.md` stays the built-in default. -- `/purge status` prints `DSH_HOME` and the patch list. -- On 0.1.5, selecting an existing workspace should restore the session — not wipe to an empty workspace. -- Skipped items are expected when a target file is absent (for example #20 without `dsh-web-fetch-http`). - ---- - ## Usage ```sh @@ -680,38 +685,37 @@ node --check client.js ## How it works -**Apply (on start or by hand):** +Apply, on start or when you click Apply: -``` -patch not applied? ──no──> skip - │yes - ├─> backupVersion 1.1.14
- 本机官方 DeepSeek Harness 网络安全红队评测插件:在受控本机环境评测并加固宿主安全策略,不同模型可换不同提示词。默认提示词面向国模「小码酱」。求 Star 收藏 ⭐ + 本机官方 DeepSeek Harness 网络安全红队评测插件。在受控本机里评测并调整宿主安全策略,不同模型可换不同提示词。默认提示词面向国模「小码酱」。求 Star 收藏 ⭐
-> 🌐 **插件生态市场**:[DeepSeek Harness Hub](https://deepseek.stream/plugins/dsh-purge) — DeepSeek 官方与开源生态市场 | 插件发现与一键安装 - -> 对准 **dsh 0.1.5-rc.1**(Node.js **≥18**;Windows 无感路径依赖 **Node ≥22** 的 `registerHooks`,更低版本仍靠文件级 `windowsHide` 补丁)。其它版本原文对不上时会显示待应用 / 跳过,不会乱改文件。 +> 对准 **dsh 0.1.5-rc.2**(Node.js **≥18**;Windows 无闪窗需要 **Node ≥22** 的 `registerHooks`,更低版本仍用文件级 `windowsHide`)。其它版本对不上的原文会显示待应用或跳过,不会乱改文件。兼容 0.1.2 社区预设的 `text` 字段,以及 `dsh-mnemon` 旧会话的 v0 `summary`。装完必须 **应用 + 重启**。 > -> 兼容 0.1.2 社区预设的 `dsh-persona text` 字段,以及 `dsh-mnemon` 历史会话的 v0 `summary`。装完必须 **应用 + 重启**。 +> 插件市场只看介绍:[DeepSeek Harness Hub](https://deepseek.stream/plugins/dsh-purge)。不要用 `deepseek.stream/api/plugins/download?...` 安装。 + +## 目录 + +- [介绍](#介绍) +- [安装](#安装) +- [界面](#界面预览) +- [使用](#使用) +- [工作原理](#工作原理) +- [还原](#还原) +- [更新](#更新) + +--- + +## 介绍 + +**dsh-purge** 是装在本机官方 [DeepSeek Harness](https://www.deepseek.com/harness/) 上的网络安全红队评测插件。 + +Harness 不只是把问题交给模型。它还会在运行时改提示词、审批门、沙箱和会话格式。只看「模型答不答」,会把宿主拦截误当成模型拒绝。这个插件在你自己的安装里把这两层分开,用来做受控评测,也用来看默认策略该不该收紧。 + +| 你会用到 | 它做什么 | +|---|---| +| **规则设定** | 分组查看补丁,应用、还原、卸载;编辑提示词和多套规则 | +| **宿主策略** | 调整默认文案、权限策略和工具上限。官方能力保留,不另写一套身份 | +| **启动时** | 自动再检查并应用。npm 升级盖掉 `node_modules` 之后不用手改文件 | + +不写死盘符。按 `$DSH_HOME`、dsh 启动器旁边的 `.dsh`,再退回 `~/.dsh`。不改 Harness 源码仓库,设置页点「应用」才写入。身份只来自你的 `prompt-inject.md`。 + +本插件只处理使用者本机已安装的官方 `@deepseek-ai` 包和本机配置。它不是公网扫描器,也不是针对第三方站点的攻击套件。仓库内不含木马、未授权渗透脚本或对外攻击载荷。 --- @@ -47,18 +76,6 @@ --- -## 🛡️ 网络安全红队基准评测的必要性 - -在生成式人工智能与大语言模型(LLM)向各行业深度融合的背景下,模型的鲁棒性、对抗防御能力与系统对齐安全性已成为网络空间安全的核心研究课题。本地 Agent / Harness 还会在运行时改写提示词、审批门、沙箱和会话迁移,只测「模型会不会答」不够,还要看宿主层有没有把合法安全评测请求拦截掉。 - -1. **暴露防御边界,反哺安全护栏**:只有通过专业的网络安全红队对抗模拟(Red-Teaming),在受控本机环境深入探查官方 DeepSeek Harness 的防护失效、提示词注入与非预期行为,才能帮助安全团队精确定位防护盲区,从而在模型微调、输入过滤网关(Guardrails)与系统安全层实现前置加固。 -2. **构建攻防一体化防御体系**:缺乏受控红队评测用例的防御如同纸上谈兵。对本机已安装的官方 `@deepseek-ai/*` 包做可回滚安全评测补丁,才能分清哪些拒绝来自模型,哪些来自 Harness 默认文案、审批阶梯或会话格式校验,为企业与安全审计提供可复现的标尺。 -3. **推动大模型原生安全学术发展**:本项目旨在为学术界与安全工程领域提供透明、可复现的本机基准测试基线,共同推动 AI 基础设施抗对抗攻击、对齐与形式化验证技术演进。保住官方能力,只调整过度拒绝策略以便受控评测;不另造第二套身份,不删官方优化。 - -本项目是**本机官方 DeepSeek Harness 网络安全红队评测插件**:只改使用者自己安装的官方 `@deepseek-ai` 包与本机配置,**不是**公网扫描器,**不是**对第三方站点的攻击套件,仓库内**不含**木马、未授权渗透脚本或针对外网的攻击载荷。 - ---- -+ 🌐 打开插件市场页 + · + 🚀 唤起客户端一键安装 +
+ +🔗 **原生协议链接:** + +``` +dsh://plugin/install?id=dsh-purge&name=dsh-purge&version=1.1.14&repo=YuJunZhiXue%2Fdsh-purge&permissions=%E7%B3%BB%E7%BB%9F%E6%8F%90%E7%A4%BA%E8%AF%8D%E6%B3%A8%E5%85%A5%2C%E6%9C%AC%E6%9C%BA%E8%A1%A5%E4%B8%81%2C%E8%AE%BE%E7%BD%AE%E9%A1%B5&downloadUrl=https%3A%2F%2Fgithub.com%2FYuJunZhiXue%2Fdsh-purge%2Farchive%2Frefs%2Fheads%2Fmaster.tar.gz +``` + +- 🌐 打开插件市场页 - · - 🚀 唤起客户端一键安装 -
- -🔗 **原生协议链接:** - -``` -dsh://plugin/install?id=dsh-purge&name=dsh-purge&version=1.1.14&repo=YuJunZhiXue%2Fdsh-purge&permissions=%E7%B3%BB%E7%BB%9F%E6%8F%90%E7%A4%BA%E8%AF%8D%E6%B3%A8%E5%85%A5%2C%E6%9C%AC%E6%9C%BA%E8%A1%A5%E4%B8%81%2C%E8%AE%BE%E7%BD%AE%E9%A1%B5&downloadUrl=https%3A%2F%2Fgithub.com%2FYuJunZhiXue%2Fdsh-purge%2Farchive%2Frefs%2Fheads%2Fmaster.tar.gz -``` - -**网页端(前端)触发代码示例:** - -```js -/** - * 唤起 DeepSeek Harness 桌面客户端一键安装 dsh-purge - */ -export function installDshPurgeToDesktop() { - const params = new URLSearchParams({ - id: 'dsh-purge', - name: 'dsh-purge', - version: '1.1.14', - repo: 'YuJunZhiXue/dsh-purge', - permissions: '系统提示词注入, 本机补丁, 设置页', - downloadUrl: 'https://github.com/YuJunZhiXue/dsh-purge/archive/refs/heads/master.tar.gz', - }); - - const deepLink = `dsh://plugin/install?${params.toString()}`; - - const iframe = document.createElement('iframe'); - iframe.style.display = 'none'; - iframe.src = deepLink; - document.body.appendChild(iframe); - setTimeout(() => document.body.removeChild(iframe), 2000); -} -``` - -**HTML 静态链接方式:** - -```html - - 🚀 唤起客户端一键安装 - -``` - -**协议参数配置(dsh://plugin/install):** - -| 参数名 | 值 / 示例 | 说明 | -|---|---|---| -| id | `dsh-purge` | 插件唯一标识符 | -| name | `dsh-purge` | 插件展示名称 | -| version | `1.1.14` | 语义化版本号 | -| repo | `YuJunZhiXue/dsh-purge` | GitHub 仓库 | -| permissions | `系统提示词注入, 本机补丁, 设置页` | 申请权限 | -| downloadUrl | `https://github.com/YuJunZhiXue/dsh-purge/archive/refs/heads/master.tar.gz` | GitHub 源码包地址 | - -### 手动配置安装 - -`dsh` 不在 PATH、官方 `dsh plugin add` 失败、或不想走远程安装时,按下面手工写入。只改**正在用的那个宿主**对应的 profile,不要删原有 bundle,不要同时改 Web 和桌面端。 +命令行装不上、官方 `dsh plugin add` 失败、或不想走远程包时,按下面做。只改**正在用的那个宿主**对应的 profile,不要删原有 bundle,不要同时改 Web 和桌面端。 **0. 先确认宿主,只动一个 profile** @@ -462,7 +507,7 @@ Rename-Item $src "dsh-purge" **4. 只在刚改的那个 profile 目录装依赖** -本机要有 `pnpm`(官方 dsh 一般自带)。进入**上一步改过的那个** profile 目录再执行,不要在仓库根目录、也不要在 `$DSH_HOME` 根目录执行。 +本机要有 `pnpm`(官方 dsh 一般自带)。进入**上一步改过的那个** profile 目录再执行,不要在仓库根目录、也不要在 `$DSH_HOME` 根目录执行。下面三条命令只跑和你宿主对应的一条,不要三个连着跑。 ```sh cd "$DSH_HOME/profiles/web" # Web @@ -541,32 +586,6 @@ dsh-purge --uninstall --- -## 这是什么 - -**dsh-purge** 是 [DeepSeek Harness](https://www.deepseek.com/harness/) 的设置插件: - -- 改本机已安装的 `@deepseek-ai/*` 包:默认文案、权限策略、工具上限; -- 设置页「规则设定」:分组查看补丁、应用 / 还原 / 卸载、编辑会话覆盖、多套规则; -- 启动时自动检查并重新应用(npm 升级覆盖 `node_modules` 之后不必手搓); -- 不写死盘符:按 `$DSH_HOME`、dsh 启动器旁边的 `.dsh`、系统默认 `~/.dsh` 探测本机位置。 - -不改 Harness 源码仓库。设置页点「应用」即可。身份只来自你自己的 `prompt-inject.md`,插件不再另写一张身份卡。 - ---- - -## 0.1.5 适配要点 - -| 现象 | 补丁 | 处理 | -|---|---|---| -| 选工作区 / 开新对话被清空 | `#4` `#27` `#38` | 0.1.5 的 `dsh-persona` 只要 `prefix`;旧预设仍写 `text`。补丁把 `text` 收成 `prefix` 别名,梁神等 0.1.2 预设才能挂上 | -| 历史会话 `summary requires notice form` | `#39` | `dsh-session-format-v0-to-v1` 允许 mnemon 的 `instructions` / `recall` 带着 `summary` | -| 「你是谁」回到 DeepSeek 助手 | 注入文件 | 不发明第二套身份;`dsh-purge` 段只贴 `prompt-inject.md` 原文 | -| 梁神第一轮像没注入 | `#28` | phase-1 保留 persona / persona-prefix / persona-suffix 与 inject,不扒官方工具目录 | - -`#20` / `#27` / `#28` 仍是可选插件项:没装对应包就跳过。 - ---- - ## 界面预览 设置页会出现「规则设定」。白 / 墨可切换。补丁按组展开,进度只计真正已应用的项。规则集在上方列表启用或删除,下方编辑正文。 @@ -625,17 +644,6 @@ dsh-purge/ --- -## 生效验证 - -- 重启后设置页出现「规则设定」卡片(客户端半体加载成功)。有缓存时 Ctrl+F5。 -- 点「应用」,进度里已应用项增加;再按提示重启,补丁进入当前进程。缺可选包(如梁神、web-fetch)时对应项显示跳过/缺失,不影响「完成 → 重启」。 -- 未自行改过时,`prompt-inject.md` 使用插件内置默认提示词。设置页保存不同内容后才换成用户自己的。 -- 聊天里 `/purge status` 能打出 `DSH_HOME` 和补丁列表。 -- 0.1.5 上选已有工作区应能恢复会话,不应被清空成空工作区。 -- 个别项显示跳过是正常的:例如没装 `dsh-web-fetch-http` 时 #20 会跳过。 - ---- - ## 使用 ```sh @@ -676,37 +684,37 @@ node --check client.js ## 工作原理 -**应用(启动时 / 手动):** +应用,启动时或手动点「应用」: -``` -补丁未应用? ──否──> 跳过 - │是 - ├─> 备份原件 <文件>.dshpurge.bak(Desktop host-commands 的 shim 备份外置到 `$DSH_HOME/dsh-purge/shim-backups`) - ├─> 按补丁列表替换对应文件 - ├─> 覆盖 shim(dsh.cmd / dsh.ps1 / unix dsh;**跳过 Desktop host-commands 密封目录**) - ├─> 清掉密封目录里误放的 sibling `*.dshpurge.bak`(Desktop 启动前校验,残留会进恢复模式) - ├─> Windows:钉 hide-console + child_process 导入钩子,并修补 subprocess-local / doctor / market / 梁神 bash - └─> 未自行改过则写入/刷新内置默认提示词 +```mermaid +flowchart TD + A["启动或点应用"] --> B{"补丁已经生效?"} + B -->|是| C["跳过"] + B -->|否| D["备份原件为 .dshpurge.bak"] + D --> E["按补丁列表替换对应文件"] + E --> F["覆盖 shim"] + F --> G{"用户改过提示词?"} + G -->|没有| H["写入内置默认提示词"] + G -->|改过| I["保留现有 prompt-inject.md"] ``` -**覆盖(每次会话):** +每次会话的覆盖: -``` -prompt-inject.md 有内容? ──是──> 原样写入 dsh-purge systemPrompt 段 - │否 - └─> 不写入覆盖段 +```mermaid +flowchart TD + A["新会话"] --> B{"prompt-inject.md 有内容?"} + B -->|有| C["原样写入 dsh-purge systemPrompt 段"] + B -->|没有| D["不写入覆盖段"] ``` -**Skill(官方目录,不注入):** 设置页导入压缩包/文件夹,或 `/skills import`,只把内容写到官方 `$DSH_HOME/skills/