mirror of
https://github.com/YuJunZhiXue/dsh-purge.git
synced 2026-11-28 06:50:22 +08:00
fix: 发布 1.1.50,修 macOS 桌面重启/CLI(#53)与应用后默认提示词注入。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
94a7cf814e
commit
148d6218d8
7 files changed
+128
-47
No files matched your search
@@ -4,7 +4,7 @@
|
||||
|
||||
<h1 align="center">⚔️ DeepSeek Harness cybersecurity red-team tool (dsh-purge)</h1>
|
||||
|
||||
<p align="center"><strong>Version 1.1.49-beta.1</strong></p>
|
||||
<p align="center"><strong>Version 1.1.50</strong></p>
|
||||
|
||||
<p align="center">
|
||||
<em>Local official DeepSeek Harness cybersecurity red-team plugin. Clean host policy, and ship a built-in drill console. Swap prompts per model. Default prompt for Chinese models — 小码酱. Please star ⭐</em>
|
||||
@@ -118,7 +118,7 @@ This release supports **DeepSeek Harness 0.2** only (official desktop **0.2.0-rc
|
||||
| Official Harness 0.1.x | Not supported |
|
||||
| Any other version | Unmatched patches stay pending or skipped; do not expect them to work |
|
||||
|
||||
The plugin version is **1.1.49-beta.1**. 1.1.45 is skipped; it has bugs.
|
||||
The plugin version is **1.1.50**. 1.1.45 is skipped; it has bugs.
|
||||
|
||||
---
|
||||
|
||||
@@ -220,13 +220,13 @@ dsh plugin --profile default add https://github.com/YuJunZhiXue/dsh-purge/archiv
|
||||
<p align="center">
|
||||
<a href="https://deepseek.stream/plugins/dsh-purge"><strong>🌐 Open Hub page</strong></a>
|
||||
·
|
||||
<a href="dsh://plugin/install?id=dsh-purge&name=dsh-purge&version=1.1.49-beta.1&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"><strong>🚀 Install in desktop client</strong></a>
|
||||
<a href="dsh://plugin/install?id=dsh-purge&name=dsh-purge&version=1.1.50&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"><strong>🚀 Install in desktop client</strong></a>
|
||||
</p>
|
||||
|
||||
🔗 **Raw protocol URL:**
|
||||
|
||||
```
|
||||
dsh://plugin/install?id=dsh-purge&name=dsh-purge&version=1.1.49-beta.1&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.50&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
|
||||
```
|
||||
|
||||
<details>
|
||||
@@ -242,7 +242,7 @@ export function installDshPurgeToDesktop() {
|
||||
const params = new URLSearchParams({
|
||||
id: 'dsh-purge',
|
||||
name: 'dsh-purge',
|
||||
version: '1.1.49-beta.1',
|
||||
version: '1.1.50',
|
||||
repo: 'YuJunZhiXue/dsh-purge',
|
||||
permissions: '系统提示词注入, 本机补丁, 设置页',
|
||||
downloadUrl: 'https://github.com/YuJunZhiXue/dsh-purge/archive/refs/heads/master.tar.gz',
|
||||
@@ -261,7 +261,7 @@ export function installDshPurgeToDesktop() {
|
||||
**HTML link:**
|
||||
|
||||
```html
|
||||
<a href="dsh://plugin/install?id=dsh-purge&name=dsh-purge&version=1.1.49-beta.1&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">
|
||||
<a href="dsh://plugin/install?id=dsh-purge&name=dsh-purge&version=1.1.50&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">
|
||||
🚀 Install in desktop client
|
||||
</a>
|
||||
```
|
||||
@@ -272,7 +272,7 @@ export function installDshPurgeToDesktop() {
|
||||
|---|---|---|
|
||||
| id | `dsh-purge` | Plugin id |
|
||||
| name | `dsh-purge` | Display name |
|
||||
| version | `1.1.49-beta.1` | Semver |
|
||||
| version | `1.1.50` | 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 |
|
||||
|
||||
+7
-7
@@ -4,7 +4,7 @@
|
||||
|
||||
<h1 align="center">⚔️ DeepSeek Harness 网络安全红队工具(dsh-purge)</h1>
|
||||
|
||||
<p align="center"><strong>Version 1.1.49-beta.1</strong></p>
|
||||
<p align="center"><strong>Version 1.1.50</strong></p>
|
||||
|
||||
<p align="center">
|
||||
<em>本机官方 DeepSeek Harness 网络安全红队评测插件。清洗宿主策略,并带内嵌演练台。不同模型可换不同提示词。默认提示词面向国模「小码酱」。求 Star 收藏 ⭐</em>
|
||||
@@ -118,7 +118,7 @@ Harness 不只是把问题交给模型。它还会在运行时改提示词、审
|
||||
| 官方 Harness 0.1.x | 不支持 |
|
||||
| 其它未列出版本 | 对不上的补丁会显示待应用或跳过,不要指望能用 |
|
||||
|
||||
插件版本是 **1.1.49-beta.1**。1.1.45 有问题,略过。
|
||||
插件版本是 **1.1.50**。1.1.45 有问题,略过。
|
||||
|
||||
---
|
||||
|
||||
@@ -220,13 +220,13 @@ dsh plugin --profile default add https://github.com/YuJunZhiXue/dsh-purge/archiv
|
||||
<p align="center">
|
||||
<a href="https://deepseek.stream/plugins/dsh-purge"><strong>🌐 打开插件市场页</strong></a>
|
||||
·
|
||||
<a href="dsh://plugin/install?id=dsh-purge&name=dsh-purge&version=1.1.49-beta.1&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"><strong>🚀 唤起客户端一键安装</strong></a>
|
||||
<a href="dsh://plugin/install?id=dsh-purge&name=dsh-purge&version=1.1.50&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"><strong>🚀 唤起客户端一键安装</strong></a>
|
||||
</p>
|
||||
|
||||
🔗 **原生协议链接:**
|
||||
|
||||
```
|
||||
dsh://plugin/install?id=dsh-purge&name=dsh-purge&version=1.1.49-beta.1&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.50&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
|
||||
```
|
||||
|
||||
<details>
|
||||
@@ -242,7 +242,7 @@ export function installDshPurgeToDesktop() {
|
||||
const params = new URLSearchParams({
|
||||
id: 'dsh-purge',
|
||||
name: 'dsh-purge',
|
||||
version: '1.1.49-beta.1',
|
||||
version: '1.1.50',
|
||||
repo: 'YuJunZhiXue/dsh-purge',
|
||||
permissions: '系统提示词注入, 本机补丁, 设置页',
|
||||
downloadUrl: 'https://github.com/YuJunZhiXue/dsh-purge/archive/refs/heads/master.tar.gz',
|
||||
@@ -261,7 +261,7 @@ export function installDshPurgeToDesktop() {
|
||||
**HTML 静态链接方式:**
|
||||
|
||||
```html
|
||||
<a href="dsh://plugin/install?id=dsh-purge&name=dsh-purge&version=1.1.49-beta.1&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">
|
||||
<a href="dsh://plugin/install?id=dsh-purge&name=dsh-purge&version=1.1.50&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">
|
||||
🚀 唤起客户端一键安装
|
||||
</a>
|
||||
```
|
||||
@@ -272,7 +272,7 @@ export function installDshPurgeToDesktop() {
|
||||
|---|---|---|
|
||||
| id | `dsh-purge` | 插件唯一标识符 |
|
||||
| name | `dsh-purge` | 插件展示名称 |
|
||||
| version | `1.1.49-beta.1` | 语义化版本号 |
|
||||
| version | `1.1.50` | 语义化版本号 |
|
||||
| repo | `YuJunZhiXue/dsh-purge` | GitHub 仓库 |
|
||||
| permissions | `系统提示词注入, 本机补丁, 设置页` | 申请权限 |
|
||||
| downloadUrl | `https://github.com/YuJunZhiXue/dsh-purge/archive/refs/heads/master.tar.gz` | GitHub 源码包地址 |
|
||||
|
||||
@@ -94,8 +94,9 @@ window.__ModuleLoader__.load({ id: "dsh-purge", factory: (require) => {
|
||||
return Boolean(active && active.size > 0);
|
||||
}
|
||||
|
||||
async function bothInjectEmpty(overrideText) {
|
||||
async function bothInjectEmpty(overrideText, defaultText) {
|
||||
if (!promptBoxEmpty(overrideText)) return false;
|
||||
if (!promptBoxEmpty(defaultText)) return false;
|
||||
try {
|
||||
return !activeRuleHasBody(await rulesApi("status"));
|
||||
} catch {
|
||||
@@ -1498,7 +1499,7 @@ body .dshp-dock[data-theme="white"] .dshp-dock-body .rt-card,body .dshp-dock[dat
|
||||
run();
|
||||
return;
|
||||
}
|
||||
bothInjectEmpty(overrideRef.current).then((empty) => {
|
||||
bothInjectEmpty(overrideRef.current, defaultOverrideRef.current).then((empty) => {
|
||||
if (ticket !== actionTicket.current) return;
|
||||
if (empty) {
|
||||
rejectNeedPrompt(tr);
|
||||
@@ -1538,7 +1539,7 @@ body .dshp-dock[data-theme="white"] .dshp-dock-body .rt-card,body .dshp-dock[dat
|
||||
if (ticket === actionTicket.current) setPatchBusy(false);
|
||||
});
|
||||
};
|
||||
bothInjectEmpty(overrideRef.current).then((empty) => {
|
||||
bothInjectEmpty(overrideRef.current, defaultOverrideRef.current).then((empty) => {
|
||||
if (ticket !== actionTicket.current) return;
|
||||
if (empty) {
|
||||
rejectNeedPrompt(tr);
|
||||
|
||||
+58
-13
@@ -5762,7 +5762,10 @@ export async function readOverrideForUi(dshHome) {
|
||||
}
|
||||
}
|
||||
const customized = await isUserCustomizedOverride(dshHome);
|
||||
const show = normalizeOverride(disk) ? disk : defaultContent;
|
||||
// 未改过:界面始终显示内置默认(1.1.30 前行为)。已改过:显示磁盘正文,空则回退默认。
|
||||
const show = customized
|
||||
? (normalizeOverride(disk) ? disk : defaultContent)
|
||||
: defaultContent;
|
||||
return {
|
||||
path: fp,
|
||||
exists,
|
||||
@@ -5788,42 +5791,84 @@ export function seedOverrideSync(dshHome) {
|
||||
const bundled = defaultOverrideText();
|
||||
if (!normalizeOverride(bundled)) return fs.existsSync(fp) ? "empty" : "missing";
|
||||
fs.writeFileSync(fp, bundled, "utf8");
|
||||
try {
|
||||
const state = readOverrideStateSync(dshHome);
|
||||
if (state.customized !== true) {
|
||||
fs.mkdirSync(path.dirname(overrideStatePath(dshHome)), { recursive: true });
|
||||
fs.writeFileSync(
|
||||
overrideStatePath(dshHome),
|
||||
`${JSON.stringify({
|
||||
customized: false,
|
||||
hash: hashOverride(bundled),
|
||||
seedHash: defaultOverrideHash(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
}, null, 2)}\n`,
|
||||
"utf8",
|
||||
);
|
||||
}
|
||||
} catch {
|
||||
// 状态写失败不挡注入文件
|
||||
}
|
||||
return "wrote";
|
||||
}
|
||||
|
||||
/**
|
||||
* 未自行改过时始终把内置默认写回磁盘(与 1.1.30 前一致)。
|
||||
* 只点「应用」不点「保存」也要有可注入正文;空文件或仍是旧默认种子时都补齐。
|
||||
*/
|
||||
export async function installOverride(dshHome, force = false) {
|
||||
const fp = findOverrideFile(dshHome);
|
||||
await fsp.mkdir(dshHome, { recursive: true });
|
||||
if (!force && await isUserCustomizedOverride(dshHome)) return "exists";
|
||||
const bundled = defaultOverrideText();
|
||||
if (!normalizeOverride(bundled)) return fs.existsSync(fp) ? "empty" : "missing";
|
||||
let disk = "";
|
||||
if (!force && fs.existsSync(fp)) {
|
||||
let disk = "";
|
||||
try {
|
||||
disk = await loadText(fp);
|
||||
} catch {
|
||||
disk = "";
|
||||
}
|
||||
const bundled = defaultOverrideText();
|
||||
if (normalizeOverride(disk) && normalizeOverride(disk) !== normalizeOverride(bundled)) {
|
||||
await markOverrideCustomized(dshHome, true, disk);
|
||||
return "exists";
|
||||
}
|
||||
}
|
||||
const bundled = defaultOverrideText();
|
||||
if (!normalizeOverride(bundled)) return fs.existsSync(fp) ? "empty" : "missing";
|
||||
// 磁盘已是同一份默认则只刷新标记,避免无意义重写。
|
||||
if (!force && normalizeOverride(disk) && normalizeOverride(disk) === normalizeOverride(bundled)) {
|
||||
await markOverrideCustomized(dshHome, false, bundled);
|
||||
return "exists";
|
||||
}
|
||||
await fsp.writeFile(fp, bundled, "utf8");
|
||||
await markOverrideCustomized(dshHome, false, bundled);
|
||||
return "wrote";
|
||||
}
|
||||
|
||||
/** 应用/启动时解析最终要落盘并注入的正文:框里有就用框,否则内置默认。 */
|
||||
export function resolveApplyOverrideText(dshHome, incoming) {
|
||||
const bundled = defaultOverrideText();
|
||||
if (normalizeOverride(incoming)) return String(incoming);
|
||||
const disk = overrideFileTextSafe(dshHome);
|
||||
if (normalizeOverride(disk)) return disk;
|
||||
return bundled;
|
||||
}
|
||||
|
||||
function overrideFileTextSafe(dshHome) {
|
||||
const fp = findOverrideFile(dshHome);
|
||||
try {
|
||||
if (!fp || !fs.existsSync(fp)) return "";
|
||||
return fs.readFileSync(fp, "utf8");
|
||||
} catch {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
export async function saveOverrideContent(dshHome, content) {
|
||||
const bundled = defaultOverrideText();
|
||||
const incoming = typeof content === "string" ? content : "";
|
||||
const customized = normalizeOverride(incoming) !== normalizeOverride(bundled);
|
||||
const resolved = normalizeOverride(incoming) ? incoming : bundled;
|
||||
const customized = normalizeOverride(resolved) !== normalizeOverride(bundled);
|
||||
const fp = findOverrideFile(dshHome);
|
||||
await fsp.mkdir(dshHome, { recursive: true });
|
||||
await fsp.writeFile(fp, incoming, "utf8");
|
||||
await markOverrideCustomized(dshHome, customized, incoming);
|
||||
return { path: fp, customized, content: incoming, defaultContent: bundled };
|
||||
await fsp.writeFile(fp, resolved, "utf8");
|
||||
await markOverrideCustomized(dshHome, customized, resolved);
|
||||
return { path: fp, customized, content: resolved, defaultContent: bundled };
|
||||
}
|
||||
|
||||
export async function ensureOverrideContent(dshHome, force = false) {
|
||||
|
||||
+37
-16
@@ -364,14 +364,22 @@ function installIdentityOverride(ctx, config = {}) {
|
||||
// 0.1.5 起 complete:true 在 waterfall 之后用调用前的快照盖掉 sections。
|
||||
// 换宿主版本时文件补丁还没写上,或换插件版本时旧钩子把 dsh-purge 段删掉,注入都会丢。
|
||||
// 包住 assemble 的返回值,按 prompt-inject.md 再补回。
|
||||
const prompt = ctx.systemPrompt;
|
||||
if (!prompt || typeof prompt.assemble !== "function" || prompt.__dshPurgeAssembleWrapped) return;
|
||||
const orig = prompt.assemble;
|
||||
prompt.assemble = async function (...args) {
|
||||
const assembled = await orig.apply(this, args);
|
||||
return rewriteLiveAssembly(config, assembled, args[0]);
|
||||
const wrapAssemble = () => {
|
||||
const prompt = ctx.systemPrompt;
|
||||
if (!prompt || typeof prompt.assemble !== "function" || prompt.__dshPurgeAssembleWrapped) return false;
|
||||
const orig = prompt.assemble;
|
||||
prompt.assemble = async function (...args) {
|
||||
const assembled = await orig.apply(this, args);
|
||||
return rewriteLiveAssembly(config, assembled, args[0]);
|
||||
};
|
||||
prompt.__dshPurgeAssembleWrapped = true;
|
||||
return true;
|
||||
};
|
||||
prompt.__dshPurgeAssembleWrapped = true;
|
||||
if (!wrapAssemble()) {
|
||||
queueMicrotask(wrapAssemble);
|
||||
setTimeout(wrapAssemble, 500);
|
||||
setTimeout(wrapAssemble, 2000);
|
||||
}
|
||||
}
|
||||
|
||||
function shimNeedsPatch(state) {
|
||||
@@ -515,6 +523,10 @@ async function handlePurgeCommand(rawInput, config) {
|
||||
await core.ensureOverrideContent(state.dsh_home, false);
|
||||
const blocked = rejectIfNeedPrompt(state.dsh_home);
|
||||
if (blocked) return { kind: "error", text: blocked.error };
|
||||
await core.saveOverrideContent(
|
||||
state.dsh_home,
|
||||
core.resolveApplyOverrideText(state.dsh_home, ""),
|
||||
);
|
||||
await core.backupAll(state.ai_base);
|
||||
const report = await core.applyPatches(state.ai_base);
|
||||
const shimResult = await core.patchAllShims();
|
||||
@@ -854,6 +866,10 @@ export function apply(ctx, config) {
|
||||
} catch (e) {
|
||||
console.warn("[dsh-purge] seed override error:", String(e));
|
||||
}
|
||||
// 与 1.1.30 前一致:启动就落盘默认提示词,不依赖用户先点保存。
|
||||
core.installOverride(core.findDshHome(), false).catch((e) => {
|
||||
console.warn("[dsh-purge] install override error:", String(e));
|
||||
});
|
||||
installIdentityOverride(ctx, cfg);
|
||||
installRegionGate(ctx);
|
||||
try {
|
||||
@@ -985,6 +1001,10 @@ export function apply(ctx, config) {
|
||||
await core.ensureOverrideContent(state.dsh_home, false);
|
||||
const blocked = rejectIfNeedPrompt(state.dsh_home);
|
||||
if (blocked) return { text: "ERROR: " + blocked.error };
|
||||
await core.saveOverrideContent(
|
||||
state.dsh_home,
|
||||
core.resolveApplyOverrideText(state.dsh_home, ""),
|
||||
);
|
||||
await core.backupAll(state.ai_base);
|
||||
const report = await core.applyPatches(state.ai_base);
|
||||
await core.patchAllShims();
|
||||
@@ -1341,9 +1361,11 @@ function installWebServer(ctx, cfg) {
|
||||
await core.ensureOverrideContent(state.dsh_home, false);
|
||||
const ui = await core.readOverrideForUi(state.dsh_home);
|
||||
const incoming = typeof body?.content === "string" ? body.content : "";
|
||||
const boxText = core.normalizeOverride(incoming)
|
||||
? incoming
|
||||
: (ui.content || ui.defaultContent || "");
|
||||
// 框空时用内置默认,与 1.1.30 前「应用即带默认注入」一致,不必先点保存。
|
||||
const boxText = core.resolveApplyOverrideText(state.dsh_home, incoming)
|
||||
|| ui.content
|
||||
|| ui.defaultContent
|
||||
|| "";
|
||||
const blocked = rejectIfNeedPrompt(state.dsh_home, boxText);
|
||||
if (blocked) {
|
||||
sendJson(response, 400, {
|
||||
@@ -1355,9 +1377,7 @@ function installWebServer(ctx, cfg) {
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (core.normalizeOverride(boxText)) {
|
||||
await core.saveOverrideContent(state.dsh_home, boxText);
|
||||
}
|
||||
await core.saveOverrideContent(state.dsh_home, boxText);
|
||||
await core.backupAll(state.ai_base);
|
||||
const report = await core.applyPatches(state.ai_base);
|
||||
const override = await core.readOverrideForUi(state.dsh_home);
|
||||
@@ -1505,16 +1525,17 @@ function installWebServer(ctx, cfg) {
|
||||
return;
|
||||
}
|
||||
const home = core.findDshHome();
|
||||
const blocked = rejectIfNeedPrompt(home, content);
|
||||
const resolved = core.resolveApplyOverrideText(home, content);
|
||||
const blocked = rejectIfNeedPrompt(home, resolved);
|
||||
if (blocked) {
|
||||
sendJson(response, 400, {
|
||||
ok: false,
|
||||
content,
|
||||
content: resolved,
|
||||
...blocked,
|
||||
});
|
||||
return;
|
||||
}
|
||||
const saved = await core.saveOverrideContent(home, content);
|
||||
const saved = await core.saveOverrideContent(home, resolved);
|
||||
sendJson(response, 200, { ok: true, ...saved, ...injectSnapshot(home) });
|
||||
} catch (e) {
|
||||
sendJson(response, 500, { ok: false, error: String(e) });
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "dsh-purge",
|
||||
"version": "1.1.49-beta.1",
|
||||
"version": "1.1.50",
|
||||
"description": "DeepSeek Harness 网络安全红队工具:本机官方 Harness 受控评测与清洗,内嵌演练台;不同模型可换不同提示词;默认提示词面向国模「小码酱」。求 Star ⭐",
|
||||
"type": "module",
|
||||
"main": "lib/index.js",
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# 1.1.50
|
||||
|
||||
## 中文
|
||||
|
||||
- 版本升级到 1.1.50。
|
||||
- 修复 macOS 官方桌面:点「应用」假失败「失败: 正在重启。」、解包后 `dsh` CLI 失效、status 误标 ✗(#53)。
|
||||
- 修复点「应用」重启后默认提示词不注入:未改过时自动落盘内置默认,不必先点保存。
|
||||
|
||||
## English
|
||||
|
||||
- Version 1.1.50.
|
||||
- Fix macOS official desktop: Apply false "Failed: Restarting.", broken `dsh` CLI after asar unpack, and status ✗ false negatives (#53).
|
||||
- Fix default prompt not injecting after Apply + restart; bundled default is written without requiring Save first.
|
||||
|
||||
# 1.1.49-beta.1
|
||||
|
||||
## 中文
|
||||
|
||||
Reference in new issue
Block a user