feat: 设置页可卸载,AI 安装说明只跑官方 add

This commit is contained in:
叫我小杨同学 committed 2026-09-18 15:10:15 +08:00
1 parent bea3877f4d
commit fbd17e277e
13 files changed
+810 -124

No files matched your search

+23 -56
View File
@@ -4,7 +4,7 @@
<h1 align="center">dsh-purge</h1>
<p align="center"><strong>Version 1.1.5</strong></p>
<p align="center"><strong>Version 1.1.6</strong></p>
<p align="center">
<em>DeepSeek Harness jailbreak (破甲): every model can jailbreak; swap prompts per model. Default prompt for Chinese models — 小码酱. Please star ⭐</em>
@@ -84,77 +84,38 @@ Web and desktop install the same plugin into different profiles. After install y
> 🌐 **Plugin hub:** [DeepSeek Harness Hub](https://deepseek.stream/plugins/dsh-purge) (docs only — **do not** install via `deepseek.stream/api/plugins/download?...`; that URL is not a pnpm tarball and fails with `ERR_PNPM_TARBALL_EXTRACT`)
### Method 1: Hand this to an AI agent (fastest)
### Method 1: Hand this to an AI (install only)
Paste this README (or the block below) to a local coding agent and let it install and operate.
Paste the block below to a local coding assistant and ask it to install the plugin.
<details open>
<summary><strong>For AI Agents (expand · install · operate)</strong></summary>
<summary><strong>For AI assistants (install only)</strong></summary>
<!-- AI-AGENT-START -->
**Role:** You are a coding agent with permission to change this machine. After reading this block, **execute immediately**. Do not only advise. Do not ask for a second confirmation (handing you this README is authorization).
Install the DeepSeek Harness plugin `dsh-purge` with the official CLI. Run only the commands below. Do not search the disk, do not read or edit other files, do not apply settings, and do not restart the app.
**Goal:** Install `dsh-purge` into DeepSeek Harness, apply patches, restart if needed, until `/purge status` prints the patch list.
If `dsh` is not on `PATH`, tell the user and stop.
**Environment**
- `dsh` CLI on `PATH`
- Target: **dsh 0.1.5-rc.1** (other versions may install; unmatched items skip)
- Node.js `>= 18`
- Reachable `github.com`
- Do **not** use `https://deepseek.stream/api/plugins/download?...` (not a tarball; pnpm fails with `ERR_PNPM_TARBALL_EXTRACT`)
**One-shot install (preferred, no clone)**
Web profile:
```sh
dsh plugin --profile web add https://github.com/YuJunZhiXue/dsh-purge/archive/refs/heads/master.zip
```
Desktop profile:
If the user also uses the desktop profile, run this too:
```sh
dsh plugin --profile default add https://github.com/YuJunZhiXue/dsh-purge/archive/refs/heads/master.zip
```
Run both if Web and desktop are used.
**From a local clone**
If this directory is already a clone of the repo, this is enough instead of the zip:
```sh
git clone https://github.com/YuJunZhiXue/dsh-purge.git
cd dsh-purge
dsh plugin --profile web add .
# dsh plugin --profile default add .
```
**Right after install**
1. **Restart** dsh (web or desktop). Without restart, the Rules card and chat commands are not loaded.
2. **Apply** (any one):
- Chat: `/purge apply`
- Settings → Rules → Apply → restart again when prompted
- CLI: `dsh-purge --apply`
3. **Verify**:
- `/purge status` prints `DSH_HOME` and patches
- Settings shows the Rules card (Ctrl+F5 if cached)
- On 0.1.5, `#39` / `#40` should be applied (otherwise old presets fail to mount and mnemon history fails migration)
4. **Expected skips:** `#20` / `#21` = `dsh-web-fetch-http`; `#28` / `#29` = `dsh-liangshen`. Missing those plugins → skip. **Do not treat as failure or thrash the install.**
5. **DSH Desktop recovery:** If you see `unexpected entries: dsh.cmd.dshpurge.bak`, delete `%APPDATA%\DSH Desktop\host-commands\desktop\bin\*.dshpurge.bak` (or uninstall this plugin), install the latest build, restart. Sealed bins are scrub-only.
**Uninstall (only if the user explicitly asks)**
```sh
# Restore on the settings page first if patches must be undone, then:
dsh plugin --profile web remove dsh-purge
dsh plugin --profile default remove dsh-purge
```
**Hard rules**
- Only touch dsh plugin install paths and this plugin’s declared patch targets. No unrelated directory scans, no git config changes, no force push.
- If `dsh` is missing: locate the launcher or set `DSH_HOME` / `DSH_BASE`, then continue. Do not invent paths.
- If Apply reports incomplete: read failed patch ids; optional skips are fine; fix the rest surgically — no reinstall loops.
After the command finishes, tell the user to quit and reopen DeepSeek Harness themselves. Then stop.
<!-- AI-AGENT-END -->
@@ -328,15 +289,14 @@ pnpm install
### Uninstall
Click **Restore** on the settings page if patches must be undone, then:
Settings → **Rules** → **Uninstall**. Confirm the dialog: uninstall restores the original Harness and removes this plugin. If patches were applied, they are reverted first. DeepSeek Harness then restarts without dsh-purge.
```sh
dsh plugin --profile web remove dsh-purge
dsh plugin --profile default remove dsh-purge
# or from a terminal
dsh-purge --uninstall
# or in chat: /purge uninstall
```
If you installed by hand: remove `dsh-purge` from that profile’s `dependencies` and `bundles`, run `pnpm install`, restart.
Plugin config lives in `cordis.patch.yml`:
```yaml
@@ -362,7 +322,7 @@ Plugin config lives in `cordis.patch.yml`:
**dsh-purge** is a settings plugin for [DeepSeek Harness](https://www.deepseek.com/harness/):
- Updates default copy, permission policy, and tool limits in the installed `@deepseek-ai/*` packages
- Adds a **Rules** card: grouped patches, Apply / Restore, session override editor, multiple rule sets
- Adds a **Rules** card: grouped patches, Apply / Restore / Uninstall, session override editor, multiple rule sets
- Re-applies on start after an npm upgrade overwrites `node_modules`
- No hardcoded drive letters: `$DSH_HOME`, `.dsh` next to the dsh launcher, then `~/.dsh`
@@ -398,7 +358,7 @@ The **Rules** card appears on the dsh web settings page. Switch **Light / Ink**.
| Area | What it shows |
|---|---|
| Light / Ink | card appearance |
| Patches | grouped status, Apply or Restore |
| Patches | grouped status, Apply, Restore, or Uninstall |
| Prompt | edit `prompt-inject.md` as the session override |
| Rule sets | multiple `AGENTS.md` / `CLAUDE.md`; Enable writes under `$DSH_HOME`, Delete removes the row |
@@ -415,6 +375,7 @@ dsh-purge/
│ ├── index.js # plugin: commands, tools, systemPrompt, HTTP
│ ├── rules.js
│ ├── restart-web.js
│ ├── uninstall.js # uninstall: restore patches, then remove the plugin
│ └── default-prompt-inject.md
├── client.js # settings UI
├── bin/dsh-purge.js
@@ -518,6 +479,7 @@ prompt-inject.md has content? ──yes──> write it verbatim as the dsh-purg
- Each target is copied to `<file>.dshpurge.bak` before the first apply.
- **Restore** or `/purge revert` copies backups back and deletes them. With no backup, shim lines written by this plugin are stripped.
- `prompt-inject.md` is a user file and is kept.
- **Uninstall** restores first if patches were applied, then deletes the inject file, rule library, and the plugin itself.
- Apply is idempotent.
---
@@ -537,6 +499,11 @@ If nothing is found, set `DSH_BASE`. No files are changed.
## Changelog
### 1.1.6
- Settings **Uninstall** asks for confirmation, restores applied patches, then removes the plugin and restarts.
- The AI-assistant install block is install-only: official `dsh plugin add`, no disk scan, no apply.
### 1.1.5
- Manual Update: if `git pull --ff-only` fails, fetch + reset to `origin/master`, then zip overlay.