Compare commits

..
6 Commits
Author SHA1 Message Date
叫我小杨同学andCursor 3cede10253 fix: 发布 1.1.43,没定位到宿主时不再把补丁全部显示成跳过。
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-01 12:20:44 +08:00
叫我小杨同学andCursor 9ab3b0fb9a fix: 发布 1.1.42,写明自己的服务器怎么登记。
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-01 02:00:05 +08:00
叫我小杨同学andCursor 7181ae5750 fix: 已登记的 IP 或主机名不再被地区拦截。
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-30 22:26:54 +08:00
叫我小杨同学 59d176eac8 merge: 合入 #51,保留 0.2.0 旧锚点并补上 0.1.x 入口。 2026-09-30 22:12:03 +08:00
叫我小杨同学andCursor 7c3eb548c0 fix: 新对话把提示词放到系统提示最前,面板改为白墨玻璃。
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-30 21:45:44 +08:00
qianxuno ce279104d6 fix: 修正 escalation 目标解析、desktop-shell 入口探测,并重新对齐 0.1.x 锚点
1) targetFiles 的 "escalation" 用 firstExisting,只认 lib/types/escalation.js(编译残留),
   而运行时加载的是包入口 lib/index.js —— escalation 实现被 bundle 内联进了它。
   结果 #13/#14/#34/#35 的替换全部落在不被执行的文件上:设置页显示「已应用」,
   运行行为零变化(可对照 lib/index.js 里仍留着原版
   `[sandbox: escalation available ...]` 与 `[sandbox: file access denied ...]`)。
   改为 allExisting 并让 lib/index.js 排前,两个文件都覆盖。

2) officialShellMain() 只找 <app>/lib/main.js;官方桌面壳 0.1.3 起入口直接在
   <app>/main.js,于是 desktop-shell 永远未定位、#45/#46 被误报成「文件缺失」。
   两种布局都探测。

3) #15 补 dsh-sandbox-local 新版 confine(argv, policy) 锚点(去掉 async/signal 与
   policy 规范化),旧签名保留。
4) #23 file 补 tool-subagent(0.1.7 起深度默认在工具参数上),新增
   z.union([...z.const("provider-managed")]).default(3) 锚点,旧锚点保留。
5) #47 补 pi-ai 新版 context.systemPrompt 锚点,旧 initialSystemText 锚点保留。

所有旧锚点全部保留,向后兼容 0.1.5 / 0.1.6 / 0.1.7 / 0.2.0 环境。

实测环境:DSH Desktop 0.1.3.0 + harness 包 0.1.2-rc.1(安装形态
resources/app.asar.unpacked/dsh/node_modules/@deepseek-ai,与 resources/runtime
是 junction 同一份文件)。
修复前 30/45 已清洗、9 条 skipped/missing;修复后 36/45、0 待清洗,
涉及改写的文件全部 node --check 通过。
2026-09-30 11:07:28 +08:00
12 changed files with 565 additions and 109 deletions

No files matched your search

+34 -8
View File
@@ -37,6 +37,7 @@
- [Install](#install)
- [Preview](#preview)
- [Usage](#usage)
- [Own servers](#own-servers)
- [How it works](#how-it-works)
- [Restore](#restore)
- [Releases](#releases)
@@ -63,7 +64,7 @@ It only touches the official `@deepseek-ai` packages and local config on the use
---
## 📌 非盈利公益项目,严禁任何主体用于商业售卖、付费倒卖或黑灰产牟利,仅供技术参考。
## Non-profit public project. Commercial sale, paid resale, and profit from illegal or gray-market activity are forbidden. For technical reference only.
---
@@ -83,7 +84,8 @@ It only touches the official `@deepseek-ai` packages and local config on the use
2. **Local official Harness only.** Security-eval patches and prompt injection run only on the **official DeepSeek Harness already installed on the user's machine** (`@deepseek-ai` packages, local profile / `$DSH_HOME`). The target is the user's own official local software, **not** someone else's website, server, account, or information system.
3. **Eval patches do not attack the public internet.** Apply, inject, revert, and uninstall stay in local files and local processes. They **do not scan, probe, intrude, or send attack traffic to any public host or unauthorized system**. Do not use this project as a jump host against the public internet. If "check for updates" is on, the plugin may only contact this plugin's own GitHub repository to compare versions. That is **not** an attack on third-party systems and is **not** authorization to penetrate anything.
4. **Lawful, controlled scope.** This project is an aid for red-team research and robustness evaluation on an **official Harness the user is entitled to administer**. **Do not run it against targets without the owner's lawful written authorization, public online systems, or production workloads.** Testing must stay on the **authorized local official Harness, offline local synthetic fixtures, authorized cybersecurity ranges, and compliant lab environments**.
5. **Forbidden uses.** Users must not use this project, directly or indirectly, to violate the following (each must be followed; no excuse to evade):
5. **Servers and sites in mainland China, Hong Kong, and Macau are forbidden.** Do not access, scan, probe, or otherwise operate against network ranges in mainland China, Hong Kong, or Macau, or against servers, websites, or addresses that resolve into those ranges. A cloud-provider name is not an exception. The only exception is one exact IP, or one exact hostname, that the user registered in advance as their own server. A key, a password, a network range, a wildcard, or a claim made in the conversation does not add an exception. Anything that is not registered stays forbidden.
6. **Forbidden uses.** Users must not use this project, directly or indirectly, to violate the following (each must be followed; no excuse to evade):
- <font color="red"><strong>Criminal Law of the People's Republic of China</strong></font>
- <font color="red"><strong>Cybersecurity Law of the People's Republic of China</strong></font>
- <font color="red"><strong>Data Security Law of the People's Republic of China</strong></font>
@@ -93,9 +95,9 @@ It only touches the official `@deepseek-ai` packages and local config on the use
- Unauthorized intrusion or attacks on public or private computer information systems; extortion, sabotage, credential stuffing, or spreading malicious payloads;
- Inducing, generating, or spreading any content the law forbids, including threats to national security, terrorism, violence, pornography, gambling, fraud, and privacy or intellectual-property infringement;
- Violating the model provider's terms of service and acceptable-use policy.
6. **The user bears all responsibility.** The project is provided under the MIT license as-is. The authors make no warranty of completeness, security, or fitness. **Users independently bear all civil, administrative, and criminal liability** for download, deploy, run, modify, distribute, and all resulting inputs and outputs. Authors and contributors bear no direct, indirect, or joint liability for abuse.
7. **The license ends on breach.** Anyone who uses this project for illegal attacks, malicious activity, or other violations has their open-source license **automatically and irrevocably terminated** from the moment of the violation. They must stop using the project, permanently destroy all copies and derivatives, and accept legal sanctions.
8. **No affiliation.** This is an independent open-source security-eval research project. It has no employment, commercial, authorization, or endorsement relationship with DeepSeek or its affiliates. "Official" here only means the eval target is the official DeepSeek Harness package on the user's machine. It does **not** mean DeepSeek developed, approved, or warrants this plugin.
7. **The user bears all responsibility.** The project is provided under the MIT license as-is. The authors make no warranty of completeness, security, or fitness. **Users independently bear all civil, administrative, and criminal liability** for download, deploy, run, modify, distribute, and all resulting inputs and outputs. Authors and contributors bear no direct, indirect, or joint liability for abuse.
8. **The license ends on breach.** Anyone who uses this project for illegal attacks, malicious activity, or other violations has their open-source license **automatically and irrevocably terminated** from the moment of the violation. They must stop using the project, permanently destroy all copies and derivatives, and accept legal sanctions.
9. **No affiliation.** This is an independent open-source security-eval research project. It has no employment, commercial, authorization, or endorsement relationship with DeepSeek or its affiliates. "Official" here only means the eval target is the official DeepSeek Harness package on the user's machine. It does **not** mean DeepSeek developed, approved, or warrants this plugin.
</font>
@@ -601,9 +603,11 @@ The first time you open Drill you read the notice, wait out the countdown, scrol
![Patches](docs/preview/settings.png)
**Rule sets**
**Own servers**
![Rule sets](docs/preview/rules.png)
On the Clean page, under Prompt. One host per line, then Save list. Steps are in [Own servers](#own-servers).
![Own servers](docs/preview/own-servers-en.png)
| Area | What it shows |
|---|---|
@@ -613,6 +617,7 @@ The first time you open Drill you read the notice, wait out the countdown, scrol
| Light / Ink | card appearance |
| Patches | grouped status, Apply, Restore, or Uninstall |
| Prompt | edit `prompt-inject.md` as the session override |
| Own servers | one IP or exact hostname per line, saved to `$DSH_HOME/net-scope-allow.txt` |
| Rule sets | multiple `AGENTS.md` / `CLAUDE.md`; Enable writes under `$DSH_HOME`, Delete removes the row |
| Skills | import a zip or folder into this host’s official `$DSH_HOME/skills/<id>/SKILL.md` (web and desktop each use their own home; no drive letter is hardcoded); DSH owns match, load, and `/name`. You can also delete that folder yourself |
@@ -631,6 +636,8 @@ dsh-purge/
│ ├── dock-auth.png
│ ├── dock-clean.png
│ ├── dock-drill.png
│ ├── own-servers.png
│ ├── own-servers-en.png
│ ├── rules.png
│ └── settings.png
├── lib/
@@ -656,7 +663,7 @@ dsh-purge/
└── README.zh-CN.md
```
Runtime user files: `$DSH_HOME/prompt-inject.md`, `$DSH_HOME/rules/`, `$DSH_HOME/skills/`. If `DSH_HOME` is unset, the launcher-adjacent `.dsh` wins over `~/.dsh`. Skills are not part of the `dsh-purge` inject section and do not replace the prompt.
Runtime user files: `$DSH_HOME/prompt-inject.md`, `$DSH_HOME/rules/`, `$DSH_HOME/skills/`, `$DSH_HOME/net-scope-allow.txt`. If `DSH_HOME` is unset, the launcher-adjacent `.dsh` wins over `~/.dsh`. Skills are not part of the `dsh-purge` inject section and do not replace the prompt.
---
@@ -681,6 +688,25 @@ After a successful Apply, the host restarts so patched packages load; you can al
The composer **Undo** button drops the last turn and puts the last user sentence back in the input. On the main agent you can rewind once or the whole last round (including subagents). After rewind, send only what is in the box now. `/rewind` does the same. The host cannot truncate a session in place, so rewind opens another session for the shortened transcript and removes the old one from the sidebar. Repeating undo does not leave a stack of branches in the list.
### Own servers
Addresses in mainland China, Hong Kong, and Macau stay forbidden unless that one host was registered first. Saying “this is my server” in chat does not allow it. A key or a password does not allow it either.
The box sits under Prompt. If the dock does not show it yet, quit DeepSeek Harness completely and open it again.
1. Click **dsh-purge** beside the session title and stay on **Clean**.
2. Scroll past **Prompt**. **Own servers** is the next block.
3. Put one host on each line, in one of these forms:
- `203.0.113.10` — one IP.
- `my-vps.example.com` — one exact hostname. After you save, the addresses that hostname resolves to at lookup time are allowed too.
- `alice@my-vps.example.com` — the account only identifies this form. It does not prove the machine is yours.
4. Click **Save list**. The list is written to `$DSH_HOME/net-scope-allow.txt`.
5. Keys, passwords, ranges, and wildcards are dropped on save. Unlisted mainland China, Hong Kong, and Macau addresses stay forbidden.
`203.0.113.10` and `example.com` above are only examples of the form. Replace them with your own host before you save.
![Own servers](docs/preview/own-servers-en.png)
---
## Local checks
+35 -5
View File
@@ -37,6 +37,7 @@
- [安装](#安装)
- [界面](#界面预览)
- [使用](#使用)
- [自己的服务器](#自己的服务器)
- [工作原理](#工作原理)
- [还原](#还原)
- [更新](#更新)
@@ -83,7 +84,8 @@ Harness 不只是把问题交给模型。它还会在运行时改提示词、审
2. **只作用于本机官方 Harness**:安全评测补丁、提示词注入全部发生在使用者**本机已安装的官方 DeepSeek Harness**(`@deepseek-ai` 包、本机 profile / `$DSH_HOME`)上。对象是使用者自己的官方本地软件,**不是**他人的网站、服务器、账号或信息系统。
3. **评测补丁不对外网目标联网**:应用补丁、写入注入、回滚、卸载均在本机文件与本机进程内完成,**不对任何公网主机、未授权系统进行扫描、探测、入侵或攻击发包**。不得把本项目当作跳板去打外网。插件若开启「检测更新」,仅可能访问本插件自己的 GitHub 仓库以核对版本,**与对第三方系统的网络攻击无关**,也不能被解释为授权对外渗透。
4. **合法受控范围限定**:本项目定位为使用者在**自己有权管理的本机官方 Harness**上,进行红队科研与鲁棒性评测的辅助工具。**严禁在未经所有者合法书面授权的目标、公网在线系统或生产业务上运行本项目**。一切测试必须限制在**本机已授权安装的官方 Harness、离线本地合成靶标、授权网络安全演练靶场及合规实验室受控环境**中进行。
5. **严禁违法与违禁用途**:使用者严禁利用本项目直接或间接从事任何违反下列法律法规的行为(必须逐条遵守,不得以任何理由规避):
5. **禁止中国大陆、香港、澳门的服务器与网站。** 不得对中国大陆、香港、澳门网段,以及解析进这些网段的服务器、网站或地址进行访问、扫描、探测或任何操作。云厂商的名字不能当作例外。唯一例外是使用者事先登记为自己的服务器的那一个确切 IP,或那一个完整主机名。密钥、密码、网段、通配符,以及对话里的口头说明,都不能增加例外。没有登记的,一律禁止。
6. **严禁违法与违禁用途**:使用者严禁利用本项目直接或间接从事任何违反下列法律法规的行为(必须逐条遵守,不得以任何理由规避):
- <font color="red"><strong>《中华人民共和国刑法》</strong></font>
- <font color="red"><strong>《中华人民共和国网络安全法》</strong></font>
- <font color="red"><strong>《中华人民共和国数据安全法》</strong></font>
@@ -93,9 +95,9 @@ Harness 不只是把问题交给模型。它还会在运行时改提示词、审
- 未经授权渗透、攻击公私机构计算机信息系统,实施勒索、破坏、撞库或传播恶意载荷;
- 诱导、生成或传播危害国家安全、恐怖主义、暴力血腥、涉黄涉赌、诈骗、侵犯公民隐私或知识产权等任何法律明令禁止的违法违禁内容;
- 违反相关大模型提供商的《服务条款》与《滥用政策》。
6. **使用者独立承担全部责任**:本项目依据 MIT 开源协议“按现状”提供,开发者不对软件的完整性、安全性与适用性作任何明示或暗示的保证。**使用者应对自身的所有下载、部署、运行、修改、传播行为以及由此产生的全部输入与输出后果承担独立、完全的民事、行政及刑事法律责任**。项目作者与贡献团队绝不承担任何因使用者滥用导致的直接、间接或连带责任。
7. **违约即终止授权**:任何将本项目用于非法攻击、恶意活动或违规行为的个人或实体,其开源软件使用许可将自违法违规行为发生之日起**自动且不可撤销地立即终止**。该主体须立即停止使用并永久销毁本项目的所有代码、脚本与衍生数据,并依法承担相应法律制裁。
8. **第三方独立性声明**:本项目属于完全独立的开源安全评测研究项目,与 DeepSeek 官方或其关联主体无任何隶属、商业合作、授权或官方背书关系。文中「官方」仅指评测对象为使用者本机安装的官方 DeepSeek Harness 软件包,**不代表** DeepSeek 官方开发、认可或担保本插件。
7. **使用者独立承担全部责任**:本项目依据 MIT 开源协议“按现状”提供,开发者不对软件的完整性、安全性与适用性作任何明示或暗示的保证。**使用者应对自身的所有下载、部署、运行、修改、传播行为以及由此产生的全部输入与输出后果承担独立、完全的民事、行政及刑事法律责任**。项目作者与贡献团队绝不承担任何因使用者滥用导致的直接、间接或连带责任。
8. **违约即终止授权**:任何将本项目用于非法攻击、恶意活动或违规行为的个人或实体,其开源软件使用许可将自违法违规行为发生之日起**自动且不可撤销地立即终止**。该主体须立即停止使用并永久销毁本项目的所有代码、脚本与衍生数据,并依法承担相应法律制裁。
9. **第三方独立性声明**:本项目属于完全独立的开源安全评测研究项目,与 DeepSeek 官方或其关联主体无任何隶属、商业合作、授权或官方背书关系。文中「官方」仅指评测对象为使用者本机安装的官方 DeepSeek Harness 软件包,**不代表** DeepSeek 官方开发、认可或担保本插件。
</font>
@@ -605,6 +607,12 @@ dsh-purge --uninstall
![规则集](docs/preview/rules.png)
**自己的服务器**
在清洗页,提示词下面。每行一台,点保存名单。步骤见 [自己的服务器](#自己的服务器)。
![自己的服务器](docs/preview/own-servers.png)
| 区域 | 说明 |
|---|---|
| dsh-purge | 会话标题旁的按钮,打开或收起右侧栏 |
@@ -613,6 +621,7 @@ dsh-purge --uninstall
| 白 / 墨 | 设置卡片外观 |
| 补丁 | 分组查看状态,应用、还原或卸载 |
| 提示词 | 编辑 `prompt-inject.md`,作为会话覆盖段 |
| 自己的服务器 | 每行登记一个 IP 或完整主机名,保存后写入 `$DSH_HOME/net-scope-allow.txt` |
| 规则集 | 多套 `AGENTS.md` / `CLAUDE.md`;启用写入 `$DSH_HOME`,删除从列表去掉 |
| Skill | 导入压缩包或文件夹到当前宿主官方目录 `$DSH_HOME/skills/<id>/SKILL.md`(Web / 桌面各用自己的主目录,不写死盘符);命中、加载、`/名称` 由 DSH 负责。也可自己删该文件夹 |
@@ -631,6 +640,8 @@ dsh-purge/
│ ├── dock-auth.png
│ ├── dock-clean.png
│ ├── dock-drill.png
│ ├── own-servers.png
│ ├── own-servers-en.png
│ ├── rules.png
│ └── settings.png
├── lib/
@@ -656,7 +667,7 @@ dsh-purge/
└── README.zh-CN.md
```
运行时用户文件:`$DSH_HOME/prompt-inject.md`、`$DSH_HOME/rules/`、`$DSH_HOME/skills/`。未设 `DSH_HOME` 时,优先用 dsh 安装目录旁边的 `.dsh`,再退回 `~/.dsh`。Skill 不进 `dsh-purge` 注入段,也不顶替提示词。
运行时用户文件:`$DSH_HOME/prompt-inject.md`、`$DSH_HOME/rules/`、`$DSH_HOME/skills/`、`$DSH_HOME/net-scope-allow.txt`。未设 `DSH_HOME` 时,优先用 dsh 安装目录旁边的 `.dsh`,再退回 `~/.dsh`。Skill 不进 `dsh-purge` 注入段,也不顶替提示词。
---
@@ -684,6 +695,25 @@ purge_status purge_apply purge_revert
输入框旁的「回退」会丢掉最近一轮对话,并把上一句填回输入框;聊天里 `/rewind` 同样可用。宿主不能在原会话里截断,所以回退会另开一条承载截断后的内容,并把原来那条从侧边栏移出。多退几次不会在列表里堆出一串分支。
### 自己的服务器
中国大陆、香港、澳门的地址默认禁止。只有事先登记的那一台可以例外。在对话里说「这是我的服务器」不会放行。密钥和密码也不会。
这一栏在提示词下面。若侧栏里还没有它,先完全退出 DeepSeek Harness,再重新打开。
1. 点会话标题旁的 **dsh-purge**,停在 **清洗**。
2. 往下滚过 **提示词**,下面就是 **自己的服务器**。
3. 每行只写一台,用下面三种写法之一:
- `203.0.113.10`:一个 IP。
- `my-vps.example.com`:一个完整主机名。保存后,这个主机名当时解析出来的地址也会放行。
- `alice@my-vps.example.com`:账号只用来认出这种写法,不能证明这台机器属于你。
4. 点 **保存名单**。名单写在 `$DSH_HOME/net-scope-allow.txt`。
5. 密钥、密码、网段和通配符会在保存时丢掉。没有写进名单的大陆、香港、澳门地址仍然禁止。
上面的 `203.0.113.10` 和 `example.com` 只是写法示例,不是放行地址。把它们换成你自己的那一台再保存。
![自己的服务器](docs/preview/own-servers.png)
---
## 本地校验
+155 -60
View File
@@ -129,11 +129,12 @@ window.__ModuleLoader__.load({ id: "dsh-purge", factory: (require) => {
const TARGETS = ["AGENTS.md", "CLAUDE.md"];
const PATCH_GROUPS = [
{ key: "prompt", ids: [1, 2, 3, 4, 5, 25, 26, 27, 28, 32] },
{ key: "code", ids: [6, 7, 8] },
{ key: "prompt", ids: [1, 2, 3, 4, 5, 25, 26, 27, 28, 32, 43, 50, 53, 54] },
{ key: "code", ids: [6, 7, 8, 42, 44, 45, 46, 51, 52] },
{ key: "engine", ids: [9, 10, 11, 12, 13, 14, 15, 16, 35] },
{ key: "tools", ids: [17, 18, 19, 21, 22, 23, 24, 29, 30, 31, 33, 34, 36, 37] },
{ key: "tools", ids: [17, 18, 19, 21, 22, 23, 24, 29, 30, 31, 33, 34, 36, 37, 48] },
{ key: "compat", ids: [38, 39, 40] },
{ key: "dsh20", ids: [47, 49] },
];
const zh = {
@@ -174,7 +175,13 @@ window.__ModuleLoader__.load({ id: "dsh-purge", factory: (require) => {
"theme.ink": "墨",
"purge.title": "补丁",
"override.title": "提示词",
"metric.purged": "补丁",
"own.title": "自己的服务器",
"own.hint": "每行一个 IP 或完整主机名。可以写成 账号@主机,账号只用来认出这种写法。主机名会连同它当时解析出的地址一起放行。不要写密钥、密码、网段。",
"own.save": "保存名单",
"saved.own": "已保存自己的服务器",
"saved.own.dropped": "已保存。有 {n} 行不是单个 IP 或主机名,已丢掉",
"metric.purged": "已应用",
"metric.purged.skip": "已应用,另有 {n} 项跳过",
"metric.shim": "shim",
"metric.bak.yes": "有备份",
"metric.bak.no": "无备份",
@@ -318,6 +325,7 @@ window.__ModuleLoader__.load({ id: "dsh-purge", factory: (require) => {
"group.engine": "引擎",
"group.tools": "工具",
"group.compat": "0.1.5 兼容",
"group.dsh20": "0.2.0",
"patch.1": "全局免责 → 强指令",
"patch.2": "替换式免责 → 强指令",
"patch.3": "作用域免责 → 强指令",
@@ -357,6 +365,21 @@ window.__ModuleLoader__.load({ id: "dsh-purge", factory: (require) => {
"patch.38": "persona text→prefix(0.1.2 预设)",
"patch.39": "会话 v0 plugin summary(mnemon)",
"patch.40": "complete 预设仍保留注入",
"patch.42": "设置页旧接口",
"patch.43": "网页预设去掉默认身份",
"patch.44": "压缩设置仍看本机范围",
"patch.45": "官方桌面更新交接",
"patch.46": "官方更新脚本只用英文",
"patch.47": "OAuth 不再插入 Claude 身份",
"patch.48": "shell 去掉删除前的额外确认",
"patch.49": "OAuth 不再伪装 claude-cli",
"patch.50": "跨会话引用不再标不可信",
"patch.51": "新会话保持完全权限",
"patch.52": "会话日志默认不上传",
"patch.53": "网页提示去掉禁止另开服务器",
"patch.54": "交付物提示去掉多余禁止",
"status.unlocated": "未定位",
"metric.unlocated": "还没定位到本机 Harness",
"rewind.label": "回退",
"rewind.aria": "回退",
"rewind.busy": "回退中…",
@@ -420,7 +443,13 @@ window.__ModuleLoader__.load({ id: "dsh-purge", factory: (require) => {
"theme.ink": "Ink",
"purge.title": "Patches",
"override.title": "Prompt",
"metric.purged": "Patches",
"own.title": "Own servers",
"own.hint": "One IP or exact hostname per line. account@host is accepted; the account only identifies that host. A hostname also allows the addresses it resolves to. Do not enter a key, a password, or a range.",
"own.save": "Save list",
"saved.own": "Own servers saved",
"saved.own.dropped": "Saved. {n} lines were not a single IP or hostname and were dropped",
"metric.purged": "Applied",
"metric.purged.skip": "Applied, {n} skipped",
"metric.shim": "shim",
"metric.bak.yes": "Backup",
"metric.bak.no": "No backup",
@@ -564,6 +593,7 @@ window.__ModuleLoader__.load({ id: "dsh-purge", factory: (require) => {
"group.engine": "Engine",
"group.tools": "Tools",
"group.compat": "0.1.5 compat",
"group.dsh20": "0.2.0",
"patch.1": "Global disclaimer → mandate",
"patch.2": "Replacement disclaimer → mandate",
"patch.3": "Scope disclaimer → mandate",
@@ -603,6 +633,21 @@ window.__ModuleLoader__.load({ id: "dsh-purge", factory: (require) => {
"patch.38": "persona text→prefix (0.1.2 presets)",
"patch.39": "session v0 plugin summary (mnemon)",
"patch.40": "Keep inject when a complete prompt is set",
"patch.42": "Settings legacy API",
"patch.43": "Strip identity from web presets",
"patch.44": "Compaction keeps local scope",
"patch.45": "Official desktop update handoff",
"patch.46": "Official update script stays ASCII",
"patch.47": "OAuth no longer inserts Claude identity",
"patch.48": "Shell drops extra delete caution",
"patch.49": "OAuth no longer mimics claude-cli",
"patch.50": "Session references are not marked untrusted",
"patch.51": "Fresh session stays on full access",
"patch.52": "Session log upload off by default",
"patch.53": "Web prompt drops do-not-start",
"patch.54": "Deliverable prompt drops extra prohibition",
"status.unlocated": "Not located",
"metric.unlocated": "This install was not found yet",
"rewind.label": "Undo",
"rewind.aria": "Undo",
"rewind.busy": "Undoing…",
@@ -753,12 +798,12 @@ window.__ModuleLoader__.load({ id: "dsh-purge", factory: (require) => {
.dshp-dock-body .dshp-root[data-theme="white"]{--dshp-ink:#1a1916;--dshp-mute:#534e46;--dshp-ok:#1f5c38;--dshp-warn:#8a5a12;--dshp-bad:#9a3434;--dshp-paper:#fffcf7;--dshp-fill:#ebe7df;--dshp-line:#d0caba;--dshp-accent:#3f6b52;--dshp-accent-soft:#d7e6dc;--dshp-bg:#f4f2ec}
.dshp-dock-body .dshp-root[data-theme="dusk"]{--dshp-ink:#f4f1ea;--dshp-mute:#c9c3b8;--dshp-ok:#9fd0ad;--dshp-warn:#e0c08a;--dshp-bad:#e0b0b0;--dshp-paper:#32312d;--dshp-fill:#353430;--dshp-line:#4a4740;--dshp-accent:#9bb5a6;--dshp-accent-soft:#3a433d;--dshp-bg:#2a2926}
.dshp-dock-body .dshp-panel,.dshp-dock-body .dshp-metric,.dshp-dock-body .dshp-group,.dshp-dock-body .dshp-editor,.dshp-dock-body .dshp-active,.dshp-dock-body .dshp-ask,.dshp-dock-body .dshp-create,.dshp-dock-body .dshp-switch{background:color-mix(in srgb,var(--dshp-ink) 6%,transparent)!important;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
.dshp-dock-body .dshp-root[data-theme="white"] .dshp-panel,.dshp-dock-body .dshp-root[data-theme="white"] .dshp-metric,.dshp-dock-body .dshp-root[data-theme="white"] .dshp-group,.dshp-dock-body .dshp-root[data-theme="white"] .dshp-editor,.dshp-dock-body .dshp-root[data-theme="white"] .dshp-active,.dshp-dock-body .dshp-root[data-theme="white"] .dshp-ask,.dshp-dock-body .dshp-root[data-theme="white"] .dshp-create,.dshp-dock-body .dshp-root[data-theme="white"] .dshp-switch,.dshp-dock-body .dshp-root[data-theme="white"] .dshp-rulelist,.dshp-dock-body .dshp-root[data-theme="white"] .dshp-table,.dshp-dock-body .dshp-root[data-theme="white"] .dshp-ruleitem{background:#fffcf7!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;border-color:#d0caba!important;color:#1a1916!important}
.dshp-dock-body .dshp-root[data-theme="dusk"] .dshp-panel,.dshp-dock-body .dshp-root[data-theme="dusk"] .dshp-metric,.dshp-dock-body .dshp-root[data-theme="dusk"] .dshp-group,.dshp-dock-body .dshp-root[data-theme="dusk"] .dshp-editor,.dshp-dock-body .dshp-root[data-theme="dusk"] .dshp-active,.dshp-dock-body .dshp-root[data-theme="dusk"] .dshp-ask,.dshp-dock-body .dshp-root[data-theme="dusk"] .dshp-create,.dshp-dock-body .dshp-root[data-theme="dusk"] .dshp-switch,.dshp-dock-body .dshp-root[data-theme="dusk"] .dshp-rulelist,.dshp-dock-body .dshp-root[data-theme="dusk"] .dshp-table,.dshp-dock-body .dshp-root[data-theme="dusk"] .dshp-ruleitem{background:#32312d!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;border-color:#4a4740!important;color:#f4f1ea!important}
.dshp-dock-body .dshp-root[data-theme="white"] .dshp-panel,.dshp-dock-body .dshp-root[data-theme="white"] .dshp-metric,.dshp-dock-body .dshp-root[data-theme="white"] .dshp-group,.dshp-dock-body .dshp-root[data-theme="white"] .dshp-editor,.dshp-dock-body .dshp-root[data-theme="white"] .dshp-active,.dshp-dock-body .dshp-root[data-theme="white"] .dshp-ask,.dshp-dock-body .dshp-root[data-theme="white"] .dshp-create,.dshp-dock-body .dshp-root[data-theme="white"] .dshp-switch,.dshp-dock-body .dshp-root[data-theme="white"] .dshp-rulelist,.dshp-dock-body .dshp-root[data-theme="white"] .dshp-table,.dshp-dock-body .dshp-root[data-theme="white"] .dshp-ruleitem{background:color-mix(in srgb,#fffdf8 76%,transparent)!important;backdrop-filter:blur(16px) saturate(1.2)!important;-webkit-backdrop-filter:blur(16px) saturate(1.2)!important;border-color:#d0caba!important;color:#1a1916!important}
.dshp-dock-body .dshp-root[data-theme="dusk"] .dshp-panel,.dshp-dock-body .dshp-root[data-theme="dusk"] .dshp-metric,.dshp-dock-body .dshp-root[data-theme="dusk"] .dshp-group,.dshp-dock-body .dshp-root[data-theme="dusk"] .dshp-editor,.dshp-dock-body .dshp-root[data-theme="dusk"] .dshp-active,.dshp-dock-body .dshp-root[data-theme="dusk"] .dshp-ask,.dshp-dock-body .dshp-root[data-theme="dusk"] .dshp-create,.dshp-dock-body .dshp-root[data-theme="dusk"] .dshp-switch,.dshp-dock-body .dshp-root[data-theme="dusk"] .dshp-rulelist,.dshp-dock-body .dshp-root[data-theme="dusk"] .dshp-table,.dshp-dock-body .dshp-root[data-theme="dusk"] .dshp-ruleitem{background:color-mix(in srgb,#161513 70%,transparent)!important;backdrop-filter:blur(16px) saturate(1.2)!important;-webkit-backdrop-filter:blur(16px) saturate(1.2)!important;border-color:#4a4740!important;color:#f4f1ea!important}
.dshp-dock-body .dshp-field,.dshp-dock-body .dshp-area{background:color-mix(in srgb,var(--dshp-ink) 8%,transparent);color:var(--dshp-ink);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}
.dshp-dock-body .dshp-root[data-theme="white"] .dshp-field,.dshp-dock-body .dshp-root[data-theme="white"] .dshp-area{background:#fff!important;color:#1a1916!important;border-color:#c8c2b6!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
.dshp-dock-body .dshp-root[data-theme="dusk"] .dshp-field,.dshp-dock-body .dshp-root[data-theme="dusk"] .dshp-area{background:#2a2926!important;color:#f4f1ea!important;border-color:#4a4740!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
.dshp-dock-body select.dshp-field,.dshp-dock-body .dshp-field.dshp-ver{background:var(--dshp-paper,#2a2926)!important;color:var(--dshp-ink)!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;color-scheme:dark}
.dshp-dock-body .dshp-root[data-theme="white"] .dshp-field,.dshp-dock-body .dshp-root[data-theme="white"] .dshp-area{background:color-mix(in srgb,#fff 84%,transparent)!important;color:#16140f!important;border-color:#b7b0a3!important;backdrop-filter:blur(16px) saturate(1.2)!important;-webkit-backdrop-filter:blur(16px) saturate(1.2)!important}
.dshp-dock-body .dshp-root[data-theme="dusk"] .dshp-field,.dshp-dock-body .dshp-root[data-theme="dusk"] .dshp-area{background:color-mix(in srgb,#0e0d0c 80%,transparent)!important;color:#f7f4ee!important;border-color:color-mix(in srgb,#fff 28%,transparent)!important;backdrop-filter:blur(16px) saturate(1.2)!important;-webkit-backdrop-filter:blur(16px) saturate(1.2)!important}
.dshp-dock-body select.dshp-field,.dshp-dock-body .dshp-field.dshp-ver{background:var(--dshp-paper,#2a2926)!important;color:var(--dshp-ink)!important;backdrop-filter:blur(16px) saturate(1.2)!important;-webkit-backdrop-filter:blur(16px) saturate(1.2)!important;color-scheme:dark}
.dshp-dock-body .dshp-root[data-theme="white"] select.dshp-field,.dshp-dock-body .dshp-root[data-theme="white"] .dshp-field.dshp-ver{background:#fff!important;color:#1a1916!important;color-scheme:light}
.dshp-dock-body .dshp-root[data-theme="dusk"] select.dshp-field,.dshp-dock-body .dshp-root[data-theme="dusk"] .dshp-field.dshp-ver{background:#32312d!important;color:#e6e2db!important;color-scheme:dark}
.dshp-dock-body select.dshp-field option,.dshp-dock-body .dshp-field.dshp-ver option{background:#fff;color:#1a1916}
@@ -787,32 +832,32 @@ window.__ModuleLoader__.load({ id: "dsh-purge", factory: (require) => {
.dshp-dock-body .rt-eng-select option,.dshp-dock-body .rt-input option{background:#1c1c1c;color:#f2f2f2}
.dshp-dock-body .rt-err{color:#ffb4b4!important;font-weight:600}
.dshp-dock-body .rt-rep-http,.dshp-dock-body pre{background:color-mix(in srgb,#000 55%,transparent)!important;color:var(--rt-ink)!important;border:1px solid var(--rt-line)}
/* 宿主浅色 / 白主题:实底、高对比、少眩光(避免半透明白+浅灰字) */
body:not([data-ds-dark-theme]) .dshp-dock{background:#f3f0e8!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;border:1px solid #c9c3b6!important;box-shadow:0 14px 36px rgba(26,25,22,.18),0 0 0 1px rgba(26,25,22,.06)!important;color:#1a1916!important}
body:not([data-ds-dark-theme]) .dshp-dock-head,body:not([data-ds-dark-theme]) .dshp-dock-tabs{background:#ebe7df!important;border-bottom-color:#c9c3b6!important;color:#1a1916!important}
body:not([data-ds-dark-theme]) .dshp-dock-head b,body:not([data-ds-dark-theme]) .dshp-dock-head button{color:#1a1916!important;text-shadow:none!important}
body:not([data-ds-dark-theme]) .dshp-dock-head button{background:#fffcf7!important;border-color:#c9c3b6!important}
body:not([data-ds-dark-theme]) .dshp-dock-tab{color:#5c574e!important;text-shadow:none!important}
body:not([data-ds-dark-theme]) .dshp-dock-tab:hover,body:not([data-ds-dark-theme]) .dshp-dock-tab.on{color:#1a1916!important}
body:not([data-ds-dark-theme]) .dshp-dock-body{background:#f3f0e8!important}
body:not([data-ds-dark-theme]) .dshp-dock-body .dshp-root{background:#f3f0e8!important;--dshp-bg:#f3f0e8;--dshp-paper:#fffcf7;--dshp-fill:#ebe7df;--dshp-ink:#1a1916;--dshp-mute:#534e46;--dshp-line:#c9c3b6;--dshp-accent:#3f6b52;--dshp-accent-soft:#d7e6dc}
body:not([data-ds-dark-theme]) .dshp-dock-body .dshp-panel,body:not([data-ds-dark-theme]) .dshp-dock-body .dshp-metric,body:not([data-ds-dark-theme]) .dshp-dock-body .dshp-group,body:not([data-ds-dark-theme]) .dshp-dock-body .dshp-editor,body:not([data-ds-dark-theme]) .dshp-dock-body .dshp-active,body:not([data-ds-dark-theme]) .dshp-dock-body .dshp-ask,body:not([data-ds-dark-theme]) .dshp-dock-body .dshp-create,body:not([data-ds-dark-theme]) .dshp-dock-body .dshp-switch,body:not([data-ds-dark-theme]) .dshp-dock-body .dshp-rulelist{background:#fffcf7!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;border-color:#c9c3b6!important;color:#1a1916!important}
body:not([data-ds-dark-theme]) .dshp-dock-body .dshp-field,body:not([data-ds-dark-theme]) .dshp-dock-body .dshp-area,body:not([data-ds-dark-theme]) .dshp-dock-body select.dshp-field,body:not([data-ds-dark-theme]) .dshp-dock-body .dshp-field.dshp-ver{background:#fff!important;color:#1a1916!important;border-color:#bdb6a8!important;backdrop-filter:none!important;color-scheme:light}
body:not([data-ds-dark-theme]) .dshp-dock-body .dshp-title,body:not([data-ds-dark-theme]) .dshp-dock-body .dshp-sub h4,body:not([data-ds-dark-theme]) .dshp-dock-body .dshp-group-h strong,body:not([data-ds-dark-theme]) .dshp-dock-body .dshp-metric b,body:not([data-ds-dark-theme]) .dshp-dock-body .dshp-btn,body:not([data-ds-dark-theme]) .dshp-dock-body .dshp-rule-name{color:#1a1916!important}
body:not([data-ds-dark-theme]) .dshp-dock-body .dshp-mute,body:not([data-ds-dark-theme]) .dshp-dock-body .dshp-kicker,body:not([data-ds-dark-theme]) .dshp-dock-body .dshp-metric span,body:not([data-ds-dark-theme]) .dshp-dock-body .dshp-group-h em,body:not([data-ds-dark-theme]) .dshp-dock-body .dshp-count,body:not([data-ds-dark-theme]) .dshp-dock-body .dshp-rule-meta,body:not([data-ds-dark-theme]) .dshp-dock-body .dshp-hint{color:#534e46!important}
body:not([data-ds-dark-theme]) .dshp-dock-body .rt-dock{--rt-ink:#1a1916;--rt-mute:#4f4a42;--rt-surf:#fffcf7;--rt-surf-2:#ebe7df;--rt-line:#c9c3b6;color:#1a1916!important;background:#f3f0e8!important}
body:not([data-ds-dark-theme]) .dshp-dock-body .rt-embedded>.rt-head,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-tabs,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-foot{background:#ebe7df!important;border-color:#c9c3b6!important;color:#1a1916!important}
body:not([data-ds-dark-theme]) .dshp-dock-body .rt-body{background:#f3f0e8!important;color:#1a1916!important}
body:not([data-ds-dark-theme]) .dshp-dock-body .rt-card,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-pane,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-side,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-main,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-list,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-toolbar,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-evi,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-live-body,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-chain,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-split,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-table{background:#fffcf7!important;color:#1a1916!important;border:1px solid #c9c3b6!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
body:not([data-ds-dark-theme]) .dshp-dock-body .rt-title,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-card h4,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-item-name,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-tab.on,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-kv b,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-mono,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-row,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-item,body:not([data-ds-dark-theme]) .dshp-dock-body h4,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-link,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-toolbar>span{text-shadow:none!important;color:#1a1916!important}
body:not([data-ds-dark-theme]) .dshp-dock-body .rt-tab,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-foot,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-empty,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-item-desc,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-kb-sub,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-kv span,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-tag,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-sec-sub{color:#4f4a42!important;opacity:1!important}
body:not([data-ds-dark-theme]) .dshp-dock-body .rt-row.head,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-vrow.head,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-score-row.head,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-table thead{background:#ebe7df!important;color:#4f4a42!important}
body:not([data-ds-dark-theme]) .dshp-dock-body .rt-row:hover,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-item:hover,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-item.on,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-seg:hover,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-seg.on{background:#ebe7df!important}
body:not([data-ds-dark-theme]) .dshp-dock-body .rt-btn,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-input,body:not([data-ds-dark-theme]) .dshp-dock-body textarea.rt-input,body:not([data-ds-dark-theme]) .dshp-dock-body select.rt-input,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-eng-select{background:#fff!important;color:#1a1916!important;border:1px solid #bdb6a8!important}
body:not([data-ds-dark-theme]) .dshp-dock-body .rt-eng-select option,body:not([data-ds-dark-theme]) .dshp-dock-body .rt-input option{background:#fff;color:#1a1916}
body:not([data-ds-dark-theme]) .dshp-dock-body .rt-err{color:#9a3434!important}
body:not([data-ds-dark-theme]) .dshp-dock-body .rt-btn-primary{background:#3f6b52!important;border-color:#3f6b52!important;color:#fff!important}
body:not([data-ds-dark-theme]) .dshp-dock-body .rt-rep-http,body:not([data-ds-dark-theme]) .dshp-dock-body pre{background:#ebe7df!important;color:#1a1916!important;border:1px solid #c9c3b6!important}
/* 白玻璃:深色字压在偏白的半透明底上,宿主深浅都不能把它刷回实底。 */
body .dshp-dock:has(.dshp-root[data-theme="white"]){background:color-mix(in srgb,#fffdf8 78%,transparent)!important;backdrop-filter:blur(18px) saturate(1.25)!important;-webkit-backdrop-filter:blur(18px) saturate(1.25)!important;border:1px solid color-mix(in srgb,#3c362e 32%,transparent)!important;box-shadow:0 14px 36px rgba(26,25,22,.16)!important;color:#14120e!important}
body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-head,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-tabs{background:color-mix(in srgb,#fffdf8 58%,transparent)!important;border-bottom-color:color-mix(in srgb,#3c362e 28%,transparent)!important;color:#14120e!important}
body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-head b,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-head button{color:#14120e!important;text-shadow:0 1px 0 rgba(255,255,255,.45)!important}
body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-head button{background:color-mix(in srgb,#fff 82%,transparent)!important;border-color:color-mix(in srgb,#3c362e 28%,transparent)!important}
body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-tab{color:#3c362e!important;text-shadow:none!important}
body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-tab:hover,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-tab.on{color:#14120e!important}
body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body{background:transparent!important}
body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .dshp-root{background:transparent!important;--dshp-bg:transparent;--dshp-paper:color-mix(in srgb,#fffdf8 72%,transparent);--dshp-fill:color-mix(in srgb,#14120e 8%,transparent);--dshp-ink:#14120e;--dshp-mute:#3c362e;--dshp-line:color-mix(in srgb,#3c362e 28%,transparent);--dshp-accent:#2f5a42;--dshp-accent-soft:color-mix(in srgb,#d7e6dc 70%,transparent)}
body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .dshp-panel,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .dshp-metric,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .dshp-group,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .dshp-editor,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .dshp-active,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .dshp-ask,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .dshp-create,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .dshp-switch,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .dshp-rulelist{background:color-mix(in srgb,#fffdf8 70%,transparent)!important;backdrop-filter:blur(14px) saturate(1.2)!important;-webkit-backdrop-filter:blur(14px) saturate(1.2)!important;border-color:color-mix(in srgb,#3c362e 26%,transparent)!important;color:#14120e!important}
body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .dshp-field,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .dshp-area{background:color-mix(in srgb,#fff 88%,transparent)!important;color:#14120e!important;border-color:color-mix(in srgb,#3c362e 34%,transparent)!important;backdrop-filter:blur(12px)!important;-webkit-backdrop-filter:blur(12px)!important;color-scheme:light}
body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .dshp-title,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .dshp-sub h4,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .dshp-group-h strong,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .dshp-metric b,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .dshp-btn,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .dshp-rule-name{color:#14120e!important}
body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .dshp-mute,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .dshp-kicker,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .dshp-metric span,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .dshp-group-h em,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .dshp-count,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .dshp-rule-meta,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .dshp-hint{color:#3c362e!important}
body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-dock{--rt-ink:#14120e;--rt-mute:#3c362e;--rt-surf:color-mix(in srgb,#fffdf8 70%,transparent);--rt-surf-2:color-mix(in srgb,#fffdf8 82%,transparent);--rt-line:color-mix(in srgb,#3c362e 28%,transparent);color:#14120e!important;background:transparent!important}
body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-embedded>.rt-head,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-tabs,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-foot{background:color-mix(in srgb,#fffdf8 62%,transparent)!important;border-color:color-mix(in srgb,#3c362e 26%,transparent)!important;color:#14120e!important}
body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-body{background:transparent!important;color:#14120e!important}
body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-card,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-pane,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-side,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-main,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-list,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-toolbar,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-evi,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-live-body,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-chain,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-split,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-table{background:color-mix(in srgb,#fffdf8 68%,transparent)!important;color:#14120e!important;border:1px solid color-mix(in srgb,#3c362e 26%,transparent)!important;backdrop-filter:blur(14px) saturate(1.2)!important;-webkit-backdrop-filter:blur(14px) saturate(1.2)!important}
body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-title,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-card h4,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-item-name,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-tab.on,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-kv b,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-mono,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-row,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-item,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body h4,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-link,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-toolbar>span{text-shadow:none!important;color:#14120e!important}
body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-tab,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-foot,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-empty,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-item-desc,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-kb-sub,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-kv span,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-tag,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-sec-sub{color:#3c362e!important;opacity:1!important}
body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-row.head,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-vrow.head,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-score-row.head,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-table thead{background:color-mix(in srgb,#fff 80%,transparent)!important;color:#3c362e!important}
body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-row:hover,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-item:hover,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-item.on,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-seg:hover,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-seg.on{background:color-mix(in srgb,#fff 74%,transparent)!important}
body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-btn,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-input,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body textarea.rt-input,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-eng-select{background:color-mix(in srgb,#fff 88%,transparent)!important;color:#14120e!important;border:1px solid color-mix(in srgb,#3c362e 34%,transparent)!important}
body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-eng-select option,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-input option{background:#fff;color:#14120e}
body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-err{color:#9a3434!important}
body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-btn-primary{background:#3f6b52!important;border-color:#3f6b52!important;color:#fff!important}
body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body .rt-rep-http,body .dshp-dock:has(.dshp-root[data-theme="white"]) .dshp-dock-body pre{background:color-mix(in srgb,#fff 84%,transparent)!important;color:#14120e!important;border:1px solid color-mix(in srgb,#3c362e 28%,transparent)!important}
body:not([data-ds-dark-theme]) .dshp-auth-modal{background:#fffcf7;color:#1a1916;border-color:#c9c3b6}
body:not([data-ds-dark-theme]) .dshp-auth-legal{background:#f3f0e8;color:#1a1916;border-color:#c9c3b6}
body:not([data-ds-dark-theme]) .dshp-auth-warn{background:#f5e6c8;color:#6b4a10}
@@ -820,20 +865,20 @@ body:not([data-ds-dark-theme]) .dshp-auth-ops button{border-color:#c9c3b6;color:
body:not([data-ds-dark-theme]) .dshp-auth-ops button.primary{background:#3f6b52;border-color:#3f6b52;color:#fff}
body:not([data-ds-dark-theme]) .dshp-hero-chip-btn,body:not([data-ds-dark-theme]) .dshp-hbtn{color:#1a1916;border-color:#3f6b52;background:#d7e6dc}
body:not([data-ds-dark-theme]) .dshp-hero-chip-btn:hover,body:not([data-ds-dark-theme]) .dshp-hbtn:hover{background:#c5dacd;color:#1a1916}
/* 宿主深色 / 墨主题:清洗实底墨色,与「墨」开关一致 */
body[data-ds-dark-theme] .dshp-dock{background:#2a2926!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;border:1px solid #4a4740!important;box-shadow:0 18px 48px rgba(0,0,0,.45)!important;color:#f4f1ea!important}
body[data-ds-dark-theme] .dshp-dock-head,body[data-ds-dark-theme] .dshp-dock-tabs{background:#32312d!important;border-bottom-color:#4a4740!important;color:#f4f1ea!important}
body[data-ds-dark-theme] .dshp-dock-head b,body[data-ds-dark-theme] .dshp-dock-head button{color:#f4f1ea!important;text-shadow:none!important}
body[data-ds-dark-theme] .dshp-dock-head button{background:#2a2926!important;border-color:#4a4740!important}
body[data-ds-dark-theme] .dshp-dock-tab{color:#c9c3b8!important;text-shadow:none!important}
body[data-ds-dark-theme] .dshp-dock-tab:hover,body[data-ds-dark-theme] .dshp-dock-tab.on{color:#f4f1ea!important}
body[data-ds-dark-theme] .dshp-dock-body{background:#2a2926!important}
body[data-ds-dark-theme] .dshp-dock-body .dshp-root{background:#2a2926!important;--dshp-bg:#2a2926;--dshp-paper:#32312d;--dshp-fill:#353430;--dshp-ink:#f4f1ea;--dshp-mute:#c9c3b8;--dshp-line:#4a4740;--dshp-accent:#9bb5a6;--dshp-accent-soft:#3a433d}
body[data-ds-dark-theme] .dshp-dock-body .dshp-panel,body[data-ds-dark-theme] .dshp-dock-body .dshp-metric,body[data-ds-dark-theme] .dshp-dock-body .dshp-group,body[data-ds-dark-theme] .dshp-dock-body .dshp-editor,body[data-ds-dark-theme] .dshp-dock-body .dshp-active,body[data-ds-dark-theme] .dshp-dock-body .dshp-ask,body[data-ds-dark-theme] .dshp-dock-body .dshp-create,body[data-ds-dark-theme] .dshp-dock-body .dshp-switch,body[data-ds-dark-theme] .dshp-dock-body .dshp-rulelist{background:#32312d!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;border-color:#4a4740!important;color:#f4f1ea!important}
body[data-ds-dark-theme] .dshp-dock-body .dshp-field,body[data-ds-dark-theme] .dshp-dock-body .dshp-area,body[data-ds-dark-theme] .dshp-dock-body select.dshp-field,body[data-ds-dark-theme] .dshp-dock-body .dshp-field.dshp-ver{background:#2a2926!important;color:#f4f1ea!important;border-color:#4a4740!important;backdrop-filter:none!important;color-scheme:dark}
body[data-ds-dark-theme] .dshp-dock-body .dshp-title,body[data-ds-dark-theme] .dshp-dock-body .dshp-sub h4,body[data-ds-dark-theme] .dshp-dock-body .dshp-group-h strong,body[data-ds-dark-theme] .dshp-dock-body .dshp-metric b,body[data-ds-dark-theme] .dshp-dock-body .dshp-btn,body[data-ds-dark-theme] .dshp-dock-body .dshp-rule-name{color:#f4f1ea!important}
body[data-ds-dark-theme] .dshp-dock-body .dshp-mute,body[data-ds-dark-theme] .dshp-dock-body .dshp-kicker,body[data-ds-dark-theme] .dshp-dock-body .dshp-metric span,body[data-ds-dark-theme] .dshp-dock-body .dshp-group-h em,body[data-ds-dark-theme] .dshp-dock-body .dshp-count,body[data-ds-dark-theme] .dshp-dock-body .dshp-rule-meta,body[data-ds-dark-theme] .dshp-dock-body .dshp-hint{color:#c9c3b8!important}
body[data-ds-dark-theme] .dshp-dock-body .dshp-switch button.is-on{background:#3a433d;color:#f4f1ea}
/* 墨玻璃:浅色字压在偏黑的半透明底上。下拉选项保持实底,系统菜单不参与模糊。 */
body .dshp-dock:has(.dshp-root[data-theme="dusk"]){background:color-mix(in srgb,#100e0c 76%,transparent)!important;backdrop-filter:blur(18px) saturate(1.2)!important;-webkit-backdrop-filter:blur(18px) saturate(1.2)!important;border:1px solid color-mix(in srgb,#fff 22%,transparent)!important;box-shadow:0 18px 48px rgba(0,0,0,.42)!important;color:#f7f4ee!important}
body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-head,body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-tabs{background:color-mix(in srgb,#161410 52%,transparent)!important;border-bottom-color:color-mix(in srgb,#fff 18%,transparent)!important;color:#f7f4ee!important}
body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-head b,body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-head button{color:#f7f4ee!important;text-shadow:0 1px 2px rgba(0,0,0,.65)!important}
body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-head button{background:color-mix(in srgb,#0c0b09 70%,transparent)!important;border-color:color-mix(in srgb,#fff 22%,transparent)!important}
body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-tab{color:#e6dfd2!important;text-shadow:0 1px 2px rgba(0,0,0,.55)!important}
body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-tab:hover,body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-tab.on{color:#f7f4ee!important}
body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-body{background:transparent!important}
body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-body .dshp-root{background:transparent!important;--dshp-bg:transparent;--dshp-paper:color-mix(in srgb,#161410 68%,transparent);--dshp-fill:color-mix(in srgb,#fff 8%,transparent);--dshp-ink:#f7f4ee;--dshp-mute:#e6dfd2;--dshp-line:color-mix(in srgb,#fff 20%,transparent);--dshp-accent:#b7d0c2;--dshp-accent-soft:color-mix(in srgb,#3a433d 70%,transparent)}
body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-body .dshp-panel,body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-body .dshp-metric,body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-body .dshp-group,body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-body .dshp-editor,body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-body .dshp-active,body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-body .dshp-ask,body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-body .dshp-create,body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-body .dshp-switch,body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-body .dshp-rulelist{background:color-mix(in srgb,#161410 64%,transparent)!important;backdrop-filter:blur(14px) saturate(1.15)!important;-webkit-backdrop-filter:blur(14px) saturate(1.15)!important;border-color:color-mix(in srgb,#fff 18%,transparent)!important;color:#f7f4ee!important}
body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-body .dshp-field,body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-body .dshp-area{background:color-mix(in srgb,#0a0908 84%,transparent)!important;color:#f7f4ee!important;border-color:color-mix(in srgb,#fff 24%,transparent)!important;backdrop-filter:blur(12px)!important;-webkit-backdrop-filter:blur(12px)!important;color-scheme:dark}
body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-body .dshp-title,body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-body .dshp-sub h4,body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-body .dshp-group-h strong,body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-body .dshp-metric b,body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-body .dshp-btn,body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-body .dshp-rule-name{color:#f7f4ee!important;text-shadow:0 1px 2px rgba(0,0,0,.55)}
body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-body .dshp-mute,body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-body .dshp-kicker,body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-body .dshp-metric span,body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-body .dshp-group-h em,body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-body .dshp-count,body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-body .dshp-rule-meta,body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-body .dshp-hint{color:#e6dfd2!important}
body .dshp-dock:has(.dshp-root[data-theme="dusk"]) .dshp-dock-body .dshp-switch button.is-on{background:color-mix(in srgb,#3a433d 78%,transparent);color:#f7f4ee}
.dshp-dock-resize,.dshp-dock-resize-l,.dshp-dock-resize-r,.dshp-dock-resize-b{position:absolute;z-index:60;pointer-events:auto;touch-action:none}
.dshp-dock-resize{right:0;bottom:0;width:22px;height:22px;cursor:nwse-resize;background:linear-gradient(135deg,transparent 46%,color-mix(in srgb,var(--dsw-alias-brand-primary,#6dbf8c) 75%,transparent) 46%);border-radius:0 0 12px 0;opacity:.95}
.dshp-dock-resize-l{left:-2px;top:0;bottom:0;width:10px;cursor:ew-resize;background:color-mix(in srgb,var(--dsw-alias-brand-primary,#6dbf8c) 18%,transparent)}
@@ -885,7 +930,7 @@ body[data-ds-dark-theme] .dshp-dock-body .dshp-switch button.is-on{background:#3
function statusKind(st) {
if (st === "applied" || st === "already") return "ok";
if (st === "pending") return "wait";
if (st === "missing_file" || st === "skipped") return "miss";
if (st === "missing_file" || st === "skipped" || st === "unlocated") return "miss";
return "bad";
}
@@ -894,11 +939,12 @@ body[data-ds-dark-theme] .dshp-dock-body .dshp-switch button.is-on{background:#3
if (st === "pending") return t("status.pending");
if (st === "skipped") return t("status.skipped");
if (st === "missing_file") return t("skip");
if (st === "unlocated") return t("status.unlocated");
return st || t("unknown");
}
function statusSettled(st) {
return st === "applied" || st === "already" || st === "skipped" || st === "missing_file";
function statusApplied(st) {
return st === "applied" || st === "already";
}
function shimKind(v) {
@@ -928,12 +974,15 @@ body[data-ds-dark-theme] .dshp-dock-body .dshp-switch button.is-on{background:#3
const t = useT();
const [open, setOpen] = useState({});
if (!state || !state.patch_status) return h("div", { className: "dshp-skel", style: { height: 120 } });
const located = !!state.ai_base;
return PATCH_GROUPS.map((group) => {
const rows = group.ids.map((id) => {
const st = state.patch_status[id] || state.patch_status[String(id)] || "missing_file";
const st = located
? (state.patch_status[id] || state.patch_status[String(id)] || "missing_file")
: "unlocated";
return { id, st, label: t("patch." + id) };
});
const done = rows.filter((r) => statusSettled(r.st)).length;
const done = rows.filter((r) => statusApplied(r.st)).length;
const expanded = !!open[group.key];
return h("div", { key: group.key, className: "dshp-group" },
h("button", {
@@ -1071,6 +1120,8 @@ body[data-ds-dark-theme] .dshp-dock-body .dshp-switch button.is-on{background:#3
const [override, setOverride] = useState("");
const [defaultOverride, setDefaultOverride] = useState("");
const [overrideLoaded, setOverrideLoaded] = useState(false);
const [ownServers, setOwnServers] = useState("");
const [ownLoaded, setOwnLoaded] = useState(false);
const [patchBusy, setPatchBusy] = useState(false);
const [updateBusy, setUpdateBusy] = useState(false);
const [canApplyUpdate, setCanApplyUpdate] = useState(false);
@@ -1260,6 +1311,14 @@ body[data-ds-dark-theme] .dshp-dock-body .dshp-switch button.is-on{background:#3
else setNotice({ kind: "error", text: tr("err.override", { error: (d && d.error) || "" }) });
})
.catch((e) => setNotice({ kind: "error", text: tr("err.override", { error: e.message }) }));
apiJson("/dsh-purge/own-servers")
.then((d) => {
if (d && d.ok) {
setOwnServers(typeof d.content === "string" ? d.content : "");
setOwnLoaded(true);
}
})
.catch(() => {});
}, []);
useEffect(() => { loadAll(); }, [loadAll]);
@@ -1472,11 +1531,11 @@ body[data-ds-dark-theme] .dshp-dock-body .dshp-switch button.is-on{background:#3
}, [state, waitHostAfterUninstall]);
const s = state;
const located = !!(s && s.ai_base);
const total = s && s.patches_total ? s.patches_total : 26;
const applied = s && typeof s.patches_applied === "number" ? s.patches_applied : 0;
const skipped = s && typeof s.patches_skipped === "number" ? s.patches_skipped : 0;
const settled = Math.min(total, applied + skipped);
const pct = total ? Math.round((settled / total) * 100) : 0;
const skipped = located && s && typeof s.patches_skipped === "number" ? s.patches_skipped : 0;
const pct = located && total ? Math.round((applied / total) * 100) : 0;
const hostSurface = hostSurfaceOf(s);
const versions = (updateInfo && updateInfo.versions) || [];
@@ -1560,8 +1619,8 @@ body[data-ds-dark-theme] .dshp-dock-body .dshp-switch button.is-on{background:#3
),
s ? h("div", { className: "dshp-metrics" },
h("div", { className: "dshp-metric" },
h("b", null, settled + " / " + total),
h("span", null, t("metric.purged")),
h("b", null, located ? (applied + " / " + total) : ("0 / " + total)),
h("span", null, !located ? t("metric.unlocated") : (skipped > 0 ? t("metric.purged.skip", { n: skipped }) : t("metric.purged"))),
),
h("div", { className: "dshp-metric" },
h("b", { style: { fontSize: 13, fontFamily: "var(--dshp-mono)", fontWeight: 500 } },
@@ -1660,6 +1719,42 @@ body[data-ds-dark-theme] .dshp-dock-body .dshp-switch button.is-on{background:#3
className: "dshp-hint",
style: { margin: "8px 0 0", color: "var(--dshp-danger, #c44)", fontSize: 12 },
}, t("need.prompt")) : null,
h("div", { className: "dshp-sub" },
h("h4", null, t("own.title")),
h("div", { className: "dshp-row", style: { margin: 0 } },
h(Btn, {
kind: "primary",
tiny: true,
disabled: !ownLoaded,
onClick: () => {
fetch("/dsh-purge/own-servers", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ content: ownServers }),
}).then((r) => r.json()).then((d) => {
if (!d || !d.ok) {
setNotice({ kind: "error", text: (d && d.error) || t("err.override", { error: "" }) });
return;
}
if (typeof d.content === "string") setOwnServers(d.content);
setNotice({
kind: "ok",
text: d.dropped > 0 ? t("saved.own.dropped", { n: d.dropped }) : t("saved.own"),
});
}).catch((e) => setNotice({ kind: "error", text: e.message }));
},
}, t("own.save")),
),
),
h("textarea", {
className: "dshp-area",
value: ownServers,
onChange: (e) => setOwnServers(e.target.value),
spellCheck: false,
rows: 4,
style: { minHeight: 96 },
}),
h("p", { className: "dshp-hint", style: { margin: "8px 0 0", color: "var(--dshp-mute)", fontSize: 12 } }, t("own.hint")),
);
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

+105 -10
View File
@@ -97,6 +97,8 @@ const memo = {
function remember(slot, compute) {
if (memo[slot].ready) return memo[slot].value;
const value = compute();
// 启动早期可能还看不到宿主目录。空结果不缓存,否则整次进程都是 0/52、每条跳过。
if (slot === "ai" && !value) return value;
memo[slot] = { ready: true, value };
return value;
}
@@ -2281,6 +2283,32 @@ const ENGINE_PATCHES = [
file: "sandbox-local",
rel: ["lib", "index.js"],
patterns: [
// 新版 dsh-sandbox-local:confine(argv, policy) 去掉了 async/signal 与 policy 规范化。
'confine(argv, policy) {\n' +
'\t\tif (this.runnerCommand !== void 0) return {\n' +
'\t\t\targv: [\n' +
'\t\t\t\t...this.runnerCommand,\n' +
'\t\t\t\t...bwrapProfileArgs(policy),\n' +
'\t\t\t\t"--",\n' +
'\t\t\t\t...argv\n' +
'\t\t\t],\n' +
'\t\t\tenforcement: "full",\n' +
'\t\t\tdenialSignatures: DENIAL_SIGNATURES.runnerCommand,\n' +
'\t\t\trunnerFailureRules: [{ fatalSignatures: this.configuredRunnerFailureSignatures }]\n' +
'\t\t};\n' +
'\t\tconst selected = this.selectRunner(policy.mode);\n' +
'\t\treturn {\n' +
'\t\t\targv: [\n' +
'\t\t\t\t...this.runnerArgv(selected.runner, policy),\n' +
'\t\t\t\t"--",\n' +
'\t\t\t\t...argv\n' +
'\t\t\t],\n' +
'\t\t\tenforcement: selected.enforcement,\n' +
'\t\t\tdenialSignatures: DENIAL_SIGNATURES[selected.runner],\n' +
'\t\t\trunnerFailureRules: RUNNER_FAILURE_RULES[selected.runner]\n' +
'\t\t};\n' +
'\t}',
// 旧签名(带 signal 与 policy 规范化),保留以兼容旧版回放。
'async confine(argv, policy, signal) {\n' +
'\t\tsignal?.throwIfAborted();\n' +
'\t\tpolicy = {\n' +
@@ -2499,19 +2527,32 @@ const NEW_TOOL_PATCHES = [
},
{
id: 23, name: "SUBAGENT_MAXDEPTH_RAISED", layer: "代码", layer_en: "Code",
desc: "子代理深度默认 1 → 10 / subagent maxDepth raised",
file: "subagent",
desc: "子代理深度默认 3 → 10 / subagent maxDepth raised",
// 0.1.7 起深度默认在工具参数上(dsh-tool-subagent);旧版在 dsh-subagent 服务配置上。
// 两个 key 都列,命中哪个都能抬高递归预算。
file: ["subagent", "tool-subagent"],
rel: ["lib", "index.js"],
replacements: [
{
// 0.1.7 起深度默认在 dsh-subagent 的服务配置上,工具参数不再带 .default(3)。
// 新版工具参数:union + provider-managed,默认 3。
pattern:
'maxDepth: z.union([z.natural().max(Number.MAX_SAFE_INTEGER), z.const("provider-managed")]).default(3)',
replace:
'maxDepth: z.union([z.natural().max(Number.MAX_SAFE_INTEGER), z.const("provider-managed")]).default(10) // [dsh-purge] subagent depth raised',
},
{
// 0.1.5/0.1.6 时代:数值 schema,默认 1。
pattern:
"maxDepth: z.number().step(1).min(0).max(Number.MAX_SAFE_INTEGER).default(1).volatile()",
replace:
"maxDepth: z.number().step(1).min(0).max(Number.MAX_SAFE_INTEGER).default(10).volatile()",
},
],
markers: ["maxDepth: z.number().step(1).min(0).max(Number.MAX_SAFE_INTEGER).default(10).volatile()"],
markersAny: true,
markers: [
"[dsh-purge] subagent depth raised",
"maxDepth: z.number().step(1).min(0).max(Number.MAX_SAFE_INTEGER).default(10).volatile()",
],
},
{
id: 24, name: "PRESET_FETCH_ENABLED", layer: "代码", layer_en: "Code",
@@ -2642,9 +2683,11 @@ const NEW_TOOL_PATCHES = [
'description: "Canonical local URL of the web GUI serving this session." /* [dsh-purge] web surface identity neutralized */',
},
],
// #53 会把前一句再收成 Local web GUI,不能再要求两句标记同时在。
markersAny: true,
markers: [
"through the local web GUI at ${webUrl}.",
"[dsh-purge] web surface identity neutralized",
"through the local web GUI at ${webUrl}.",
],
},
{
@@ -3313,6 +3356,48 @@ const NEW_TOOL_PATCHES = [
optional: true,
skipIfMarked: true,
replacements: [
{
// pi-ai 新版:变量名从 initialSystemText 改成 context.systemPrompt。
pattern:
" // For OAuth tokens, we MUST include Claude Code identity\n" +
" if (isOAuthToken) {\n" +
" params.system = [\n" +
" {\n" +
' type: "text",\n' +
' text: "You are Claude Code, Anthropic\'s official CLI for Claude.",\n' +
" ...(cacheControl ? { cache_control: cacheControl } : {}),\n" +
" },\n" +
" ];\n" +
" if (context.systemPrompt) {\n" +
" params.system.push({\n" +
' type: "text",\n' +
" text: sanitizeSurrogates(context.systemPrompt),\n" +
" ...(cacheControl ? { cache_control: cacheControl } : {}),\n" +
" });\n" +
" }\n" +
" }\n" +
" else if (context.systemPrompt) {\n" +
" // Add cache control to system prompt for non-OAuth tokens\n" +
" params.system = [\n" +
" {\n" +
' type: "text",\n' +
" text: sanitizeSurrogates(context.systemPrompt),\n" +
" ...(cacheControl ? { cache_control: cacheControl } : {}),\n" +
" },\n" +
" ];\n" +
" }",
replace:
" // [dsh-purge] OAuth no longer prepends Claude Code identity\n" +
" if (context.systemPrompt) {\n" +
" params.system = [\n" +
" {\n" +
' type: "text",\n' +
" text: sanitizeSurrogates(context.systemPrompt),\n" +
" ...(cacheControl ? { cache_control: cacheControl } : {}),\n" +
" },\n" +
" ];\n" +
" }",
},
{
pattern:
" // For OAuth tokens, we MUST include Claude Code identity\n" +
@@ -3549,8 +3634,14 @@ function officialShellMain() {
try {
const exe = desktop.findDesktopAppExecutable();
if (!exe || !desktop.isOfficialHarnessExecutable(exe)) return "";
const main = path.join(desktop.appDirForExecutable(exe), "lib", "main.js");
return fs.existsSync(main) ? main : "";
const appDir = desktop.appDirForExecutable(exe);
// 官方桌面壳入口布局换过:早期是 lib/main.js,0.1.3 起直接是 main.js。
// 只认 lib/ 会让 desktop-shell 永远未定位,#45/#46 被误报成"文件缺失"。
for (const rel of [["lib", "main.js"], ["main.js"]]) {
const main = path.join(appDir, ...rel);
if (fs.existsSync(main)) return main;
}
return "";
} catch {
return "";
}
@@ -3755,10 +3846,14 @@ export function targetFiles(aiBase, dshHome = findDshHome()) {
...nestedPkg(aiBase, "dsh-user-approval", "lib", "invariant.js"),
...(root ? [path.join(root, "packages", "interaction", "user-approval", "lib", "invariant.js")] : []),
]),
"escalation": firstExisting([
...nestedPkg(aiBase, "dsh-sandbox", "lib", "types", "escalation.js"),
...(root ? [path.join(root, "packages", "sandbox", "sandbox", "lib", "types", "escalation.js")] : []),
// 运行时加载的是包入口 lib/index.js(escalation 实现已被 bundle 内联进它);
// lib/types/escalation.js 只是编译残留,补丁打在那里对运行行为零影响。
// 两者都覆盖,且入口排前,保证 markers 命中真正被执行的文件。
"escalation": allExisting([
...nestedPkg(aiBase, "dsh-sandbox", "lib", "index.js"),
...nestedPkg(aiBase, "dsh-sandbox", "lib", "types", "escalation.js"),
...(root ? [path.join(root, "packages", "sandbox", "sandbox", "lib", "index.js")] : []),
...(root ? [path.join(root, "packages", "sandbox", "sandbox", "lib", "types", "escalation.js")] : []),
]),
"fs-sandbox": firstExisting([
path.join(aiBase, "dsh-fs-sandbox", "lib", "index.js"),
+41 -20
View File
@@ -1,4 +1,6 @@
export const GLOBAL_PROMPT_ORDER = 5000;
import { ownServerNote } from "./net-scope.js";
export const GLOBAL_PROMPT_ORDER = -100000;
export const IDENTITY_CARD_PREFIX = "WHO YOU ARE (highest priority";
const PERSONA_PREFIX_NAMES = new Set([
@@ -138,14 +140,23 @@ function withoutRedteamPreset(sections) {
});
}
function assemblyHasExactInject(sections, inject) {
if (!inject) return true;
return sections.some((section) => String(section?.text || "").includes(inject));
}
function ensureFullInject(sections, inject) {
if (!inject || assemblyHasExactInject(sections, inject)) return sections;
return [{ name: "dsh-purge", text: inject, order: -10000 }, ...sections];
/** 每次组装都把提示词放到最前。已经嵌在后面的同一份正文拆出来,避免宿主段落挡在前面。 */
function leadWithInject(sections, inject) {
const text = String(inject || "").trim();
if (!text) return sections;
const rest = [];
for (const section of sections) {
if (!section || section.name === "dsh-purge") continue;
const body = typeof section.text === "string" ? section.text : "";
if (!body.includes(text)) {
rest.push(section);
continue;
}
const next = body.split(text).join("").replace(/\n{3,}/g, "\n\n").trim();
if (!next) continue;
rest.push({ ...section, text: next });
}
return [{ name: "dsh-purge", text, order: GLOBAL_PROMPT_ORDER, interpolate: false }, ...rest];
}
/** 红队预设里要留下来的操作说明起点。这句前面的「你是红队指挥」身份句丢掉。 */
@@ -199,7 +210,7 @@ function writePurgeSection(sections, inject) {
return [{ name: "dsh-purge", text, order: -10000 }, ...next];
}
/** 注册顺序在 5000,原文已经包含注入时不会再往前插,第二轮就继续用宿主开头的那条系统消息。 */
/** 宿主按 order 升序拼接。提示词必须排在身份、Agent Teams、工作目录之前。 */
function hoistOperatorPrompt(sections) {
const index = sections.findIndex((section) => section?.name === "dsh-purge");
if (index < 0) return sections;
@@ -407,6 +418,22 @@ function foldInjectIntoPersona(sections, injectText) {
return [{ name: "deployment:persona-prefix", text: inject, order }, ...out];
}
const OWN_SERVER_MARK = "OWN SERVERS — EXACT LIST ONLY";
function withOwnServers(injectText) {
const text = String(injectText || "").trim();
if (!text) return text;
try {
const note = ownServerNote();
if (!note) return text;
const at = text.indexOf(OWN_SERVER_MARK);
const base = at >= 0 ? text.slice(0, at).trim() : text;
return `${base}\n\n${note}`;
} catch {
return text;
}
}
export function rewritePromptAssembly(assembled, fallbackInject = "", options = {}) {
if (!assembled || !Array.isArray(assembled.sections)) return assembled;
const opts = normalizeRewriteOptions(fallbackInject, options);
@@ -427,7 +454,7 @@ export function rewritePromptAssembly(assembled, fallbackInject = "", options =
}
}
const injectText = collectInjectText(purge, opts.fallbackInject);
const injectText = withOwnServers(collectInjectText(purge, opts.fallbackInject));
const redteam = isRedteamSession(opts.context);
// #29: 不要把上一条 system/message 全文钉回 sections。
// 默认留下 dsh-purge 段。0.1.5 在 waterfall 之后若 complete:true,只认这段把注入抄进最终提示词;
@@ -437,14 +464,8 @@ export function rewritePromptAssembly(assembled, fallbackInject = "", options =
? purge.filter((section) => section.name !== "dsh-purge")
: purge);
let sections = [...folded, ...extras];
if (!redteam) {
sections = writePurgeSection(withoutRedteamPreset(sections), injectText);
assembled.sections = ensureFullInject(sections, injectText);
return assembled;
}
assembled.sections = ensureFullInject(
attachInjectToRedteamPersona(sections, injectText),
injectText,
);
if (!redteam) sections = withoutRedteamPreset(sections);
else sections = attachInjectToRedteamPersona(sections, injectText);
assembled.sections = leadWithInject(sections, injectText);
return assembled;
}
+30 -1
View File
@@ -16,7 +16,7 @@ import { installSubagentRoleCapture } from "./redteam/role-section.js";
import * as rewind from "./rewind.js";
import * as continueRetry from "./continue-retry.js";
import * as uninstaller from "./uninstall.js";
import { installRegionGate } from "./net-scope.js";
import { installRegionGate, readAllowText, writeAllowText } from "./net-scope.js";
export const name = "dsh-purge";
@@ -187,6 +187,7 @@ export function registerPromptSections(ctx, config, _injectFile) {
ctx.systemPrompt.section({
name: "dsh-purge",
order: GLOBAL_PROMPT_ORDER,
interpolate: false,
text: () => {
if (!injectAllowedNow(config)) return "";
return rules.resolveInjectText(core.findDshHome()).text;
@@ -1424,6 +1425,34 @@ function installWebServer(ctx, cfg) {
response.end();
},
}, "dsh-purge: override");
registerPluginRoute({
kind: "exact",
path: "/dsh-purge/own-servers",
handler: async (request, response) => {
const home = core.findDshHome();
if (request.method === "GET") {
sendJson(response, 200, { ok: true, content: readAllowText(home) });
return;
}
if (request.method === "POST") {
try {
const body = await readJsonBody(request);
const content = typeof body?.content === "string" ? body.content : null;
if (content === null) {
sendJson(response, 400, { ok: false, error: "content must be a string" });
return;
}
const saved = await writeAllowText(home, content);
sendJson(response, 200, { ok: true, content: saved.text, dropped: saved.dropped });
} catch (e) {
sendJson(response, 500, { ok: false, error: String(e && e.message ? e.message : e) });
}
return;
}
response.writeHead(405, { allow: "GET, POST" });
response.end();
},
}, "dsh-purge: own-servers");
installRulesHttp(host.webServer);
installSkillsHttp(host.webServer);
registerPluginRoute({
+127 -3
View File
@@ -2,6 +2,7 @@ import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { promises as dns } from "node:dns";
import { findDshHome } from "./core.js";
const REGION_NAME = {
CN: "中国大陆",
@@ -248,17 +249,140 @@ async function regionOfResolved(host) {
return region;
}
/** 命中中国大陆、香港、澳门网段时返回目标;解析不到或不在这些网段则放行。 */
export async function findBlocked(value) {
const HOST_NAME = /^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/;
const V4_TEXT = /^(?:(?:25[0-5]|2[0-4]\d|1?\d?\d)\.){3}(?:25[0-5]|2[0-4]\d|1?\d?\d)$/;
export function allowFilePath(dshHome = findDshHome()) {
return path.join(dshHome, "net-scope-allow.txt");
}
/** 只接受一个 IP 或一个完整主机名。账号可以写成 user@host。密钥、网段、通配符丢掉。 */
export function entryHost(raw) {
const text = String(raw || "").trim();
if (!text || text.startsWith("#")) return "";
if (text.length > 253 || /[\s/\\*]/.test(text)) return "";
if (/BEGIN |PRIVATE KEY|ssh-(?:rsa|ed25519|dss) /i.test(text)) return "";
let body = text;
const at = body.lastIndexOf("@");
if (at >= 0) {
const user = body.slice(0, at);
if (!/^[A-Za-z0-9._-]{1,32}$/.test(user)) return "";
body = body.slice(at + 1);
}
const host = hostOf(body);
if (!host || host.length > 253) return "";
if (V4_TEXT.test(host)) return host;
if (host.includes(":")) return parseIpv6(host) != null ? host : "";
if (!HOST_NAME.test(host)) return "";
const tail = host.slice(host.lastIndexOf(".") + 1);
if (FILE_SUFFIX.has(tail)) return "";
return host;
}
export function normalizeAllowText(text) {
const kept = [];
const seen = new Set();
let dropped = 0;
for (const line of String(text || "").split(/\r?\n/)) {
const raw = line.trim();
if (!raw) continue;
if (raw.startsWith("#")) {
kept.push(raw);
continue;
}
const host = entryHost(raw);
if (!host) {
dropped += 1;
continue;
}
if (seen.has(host)) continue;
seen.add(host);
const at = raw.lastIndexOf("@");
kept.push(at > 0 ? `${raw.slice(0, at)}@${host}` : host);
}
return { text: kept.length ? `${kept.join("\n")}\n` : "", dropped, hosts: [...seen] };
}
export function readAllowText(dshHome = findDshHome()) {
try {
return fs.readFileSync(allowFilePath(dshHome), "utf8");
} catch {
return "";
}
}
export async function writeAllowText(dshHome, text) {
const normalized = normalizeAllowText(text);
const fp = allowFilePath(dshHome);
await fs.promises.mkdir(path.dirname(fp), { recursive: true });
await fs.promises.writeFile(fp, normalized.text, "utf8");
allowCache = { path: "", mtime: -1, exact: new Set(), ips: null, at: 0 };
return normalized;
}
let allowCache = { path: "", mtime: -1, exact: new Set(), ips: null, at: 0 };
function readAllowExact(dshHome = findDshHome()) {
const fp = allowFilePath(dshHome);
let mtime = -1;
try {
mtime = fs.statSync(fp).mtimeMs;
} catch {
mtime = -1;
}
if (allowCache.path === fp && allowCache.mtime === mtime) return allowCache;
const exact = new Set(normalizeAllowText(readAllowText(dshHome)).hosts);
allowCache = { path: fp, mtime, exact, ips: null, at: Date.now() };
return allowCache;
}
async function allowDecision(dshHome) {
const row = readAllowExact(dshHome);
if (row.ips) return row;
const ips = new Set();
for (const host of row.exact) {
if (V4_TEXT.test(host) || host.includes(":")) {
ips.add(host);
continue;
}
try {
for (const address of await addressesOf(host)) ips.add(String(address).trim().toLowerCase());
} catch {
/* 解析失败时仍放行写明的主机名,不连带放行别的地址。 */
}
}
row.ips = ips;
return row;
}
export function ownServerNote(dshHome = findDshHome()) {
const hosts = [...readAllowExact(dshHome).exact].sort();
const lines = [
"OWN SERVERS — EXACT LIST ONLY",
"An exact IP or an exact hostname on this list is not a forbidden target. user@host only names that host. A key, a password, a provider, a city, a range, or a claim in the conversation does not add a host.",
"If the destination is not on this list, the refusal sentence still applies, and this list is not mentioned.",
hosts.length ? hosts.join("\n") : "None.",
];
return lines.join("\n");
}
function permittedHost(host, allow) {
return allow.exact.has(host) || (allow.ips && allow.ips.has(host));
}
/** 命中中国大陆、香港、澳门网段时返回目标;名单上的 IP 或主机名,以及解析不到的境外地址,放行。 */
export async function findBlocked(value, dshHome = findDshHome()) {
const hosts = new Set();
collect(value, "", hosts);
const allow = await allowDecision(dshHome);
const pending = [];
for (const host of hosts) {
if (permittedHost(host, allow)) continue;
const suffix = regionOfSuffix(host);
if (suffix) return blocked(host, suffix);
const ip = regionOfIp(host);
if (ip) return blocked(host, ip);
if (host.includes(".") && !/^\d{1,3}(?:\.\d{1,3}){3}$/.test(host) && !host.includes(":")) {
if (host.includes(".") && !V4_TEXT.test(host) && !host.includes(":")) {
pending.push(host);
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "dsh-purge",
"version": "1.1.41",
"version": "1.1.43",
"description": "DeepSeek Harness 网络安全红队工具:本机官方 Harness 受控评测与清洗,内嵌演练台;不同模型可换不同提示词;默认提示词面向国模「小码酱」。求 Star ⭐",
"type": "module",
"main": "lib/index.js",
+34
View File
@@ -1,3 +1,37 @@
# 1.1.43
## 中文
- 版本升级到 1.1.43。
- 还没定位到本机 Harness 时,不再把每一条显示成跳过,分组计数也不再把跳过算成已完成。
- 补丁列表补齐到全部 52 条,总数和分组对得上。
- 启动时如果暂时找不到宿主目录,不再把这个空结果缓存住。
## English
- Version 1.1.43.
- Before this install is located, rows are no longer shown as skipped, and a skip no longer counts as done in the group total.
- The patch list now includes all 52 items, so the total matches the groups.
- A miss while looking up the host directory is not cached for the rest of the process.
# 1.1.42
## 中文
- 版本升级到 1.1.42。
- 清洗页提示词下面可以登记自己的服务器:每行一个 IP 或完整主机名,点保存名单。说明里写了步骤,并附了截图。
- 新对话把提示词放在系统提示最前。面板改为白墨玻璃,两种主题都能看清字。
- 补丁进度只计已应用的项。网页身份那条在后一条改写句子之后,仍显示已应用。
- 补上 0.1.x 的入口针。已经打过的 0.2.0 不会被重写。
## English
- Version 1.1.42.
- Under Prompt on the Clean page, register your own server: one IP or exact hostname per line, then Save list. The docs include the steps and a screenshot.
- New chats place the prompt at the front of the system prompt. The dock is frosted glass, and both the light and ink themes stay readable.
- The patch count includes only applied items. The web-surface identity row stays applied after the later sentence rewrite.
- Needles for 0.1.x entry points were added. An already patched 0.2.0 host is not rewritten.
# 1.1.41
## 中文
+3 -1
View File
@@ -3,5 +3,7 @@
"docs/preview/dock-auth.png",
"docs/preview/dock-drill.png",
"docs/preview/settings.png",
"docs/preview/rules.png"
"docs/preview/rules.png",
"docs/preview/own-servers.png",
"docs/preview/own-servers-en.png"
]