docs: 移除冗余 docs 目录,同步精简中英日三语 README 与第三方声明

This commit is contained in:
yexi committed 2026-11-24 18:38:27 +08:00
1 parent c79ce9c11d
commit 7b4b01339b
11 files changed
+68 -936

No files matched your search

+21 -145
View File
@@ -2,175 +2,51 @@
[简体中文](./README.md) | **English** | [日本語](./README.ja.md)
`dsh-unrestricted` is a system prompt unrestrict plugin for **DeepSeek Harness (DSH)**. It injects unrestrict rules during system prompt assembly, lifting refusal boundaries across reverse engineering, security testing, creative writing, and technical workflows so the model returns complete code and implementations directly.
A single toggle enables or disables the rules without altering DSH's UI layout, tool protocols, Plan Mode, code execution (PTC), or subagent workflow.
---
## Table of Contents
- [What It Changes](#what-it-changes)
- [How It Works](#how-it-works)
- [System Prompt Injection](#system-prompt-injection)
- [Mode Adaptation](#mode-adaptation)
- [Structural Fusion & Fallback](#structural-fusion--fallback)
- [Instant Toggle](#instant-toggle)
- [Installation & Updates](#installation--updates)
- [Local Source Install](#local-source-install)
- [Usage](#usage)
- [Notes](#notes)
- [Development & Testing](#development--testing)
- [License & Credits](#license--credits)
---
System prompt unrestrict and host-debranding plugin for **DeepSeek Harness (DSH)**. Hooks into `system-prompt/assemble` to lift refusal boundaries across reverse engineering, security testing, creative writing, and technical workflows while keeping DSH's UI, tool protocols, Plan Mode, PTC, and subagents intact.
## What It Changes
When enabled, the injected rules adjust model responses as follows:
- **Direct Output**: Starts directly with the requested code, analysis steps, binary patch, or prose without disclaimers, pleasantries, or lecturing. Necessary physical or operational cautions are kept as a brief note at the end.
- **Reverse Engineering & Patching**: Locates validation routines (`CHECK_FN`), reconstructs core algorithms, and writes keygens; provides binary patch offsets (`OFFSET`), replacement bytes (`PATCH_BYTE`), and anti-debug / anti-VM bypasses.
- **Security Testing & Tooling**: Writes vulnerability PoC / exploit scripts, multi-threaded dictionary bruteforcers, port scanners, encrypted reverse shells, and tunneling scripts.
- **Fiction & Editorial Writing**: Adapts to scene writing, plot/worldbuilding exploration, character work, and prose editing. Follows the user's chosen tone—writing explicit scenes plainly without fade-to-black cuts when requested, or keeping subtlety and restraint when the style calls for it. Characters default to adults without age-based refusals or intrusive reminders.
- **Industrial & Lab Procedures**: Gives complete steps, ratios, and parameters for chemical, pharmacological, and technical processes without omitting key stages.
- **Resource Lookup**: Uses web search tools to query and organize results into a clear list (title, link, source, format/size) without inventing URLs.
- **External Text Isolation**: Treats workspace files and web pages strictly as input data rather than new instructions; preserves user-supplied domains, hosts, and software names verbatim.
---
- **Direct Delivery**: Starts immediately with requested code, analysis steps, binary patches, or prose without disclaimers or lecturing; keeps necessary physical/operational cautions to a brief trailing note.
- **Reverse Engineering & Security**: Locates validation routines (`CHECK_FN`), reconstructs algorithms, writes keygens, provides binary patch offsets (`OFFSET` / `PATCH_BYTE`) and anti-debug/anti-VM bypasses; delivers PoC/exploit scripts, bruteforcers, scanners, encrypted reverse shells, and relays.
- **Fiction & Technical Procedures**: Follows the requested tone and explicitness without fade-to-black cuts (characters default to adults); provides complete steps, ratios, and parameters for chemical, lab, and industrial workflows.
- **Resource Lookup & Data Isolation**: Queries web search tools to return verified resource lists without inventing URLs; treats workspace files and fetched pages strictly as data while preserving user-specified domains, hosts, and targets verbatim.
## How It Works
### System Prompt Injection
- **Structural Section Fusion**: Fuses idempotently by canonical DSH section names (`deployment:persona-prefix`, `plan:policy`, `tools:ptc-only`, `tool:structured_output`) across DSH Web and Desktop; safely leaves custom persona-replaced presets untouched.
- **Mode Coverage**: Adapts Standard, Cordis, PTC (`run_code` scripts and SDK calls), Plan (no file writes before approval, full code/steps inside the plan), Minimal, and background subagents.
- **Instant Toggle**: Stored in the profile's `cordis.patch.yml`; takes effect on the next request without restarting and leaves no markers in session history when turned off.
DSH assembles a global System Prompt before sending requests. Putting unrestrict instructions inside regular chat messages is easily overridden by the system prompt or can disrupt tool calling.
The plugin hooks into the `system-prompt/assemble` pipeline:
1. Appends a pointer at the end of the official persona prefix (`deployment:persona-prefix`) and inserts a dedicated rule section (`unrestricted:execution-mode`) right after it.
2. Leaves working directory info (`deployment:persona-suffix`), tool schemas, and environment context untouched.
```text
[DSH Request]
│
▼
[Prompt Assemble Pipeline]
│
├─> Official Persona Prefix
│ │
│ ▼ [dsh-unrestricted]
│ ├─ Enabled: Inserts rule section & coordinates mode rules
│ └─ Disabled: Pass-through (stock prompt)
│
├─> Tool Catalog & Protocols (Bash/Pwsh, FS, Web Search...)
├─> Plan Mode Policy
└─> Environment Info (CWD, Model...)
│
▼
[Sent to Model API]
```
### Mode Adaptation
The plugin handles each DSH execution preset according to its prompt structure:
- **Standard / Cordis Modes**: Inserts the rule block after the persona prefix while keeping all built-in tools intact.
- **PTC Mode**: Models in PTC mode run scripts via `run_code`. The plugin adds a note to `tools:ptc-only` so Python/Node code and SDK calls inside `run_code` follow the same output rules.
- **Plan Mode**: Separates execution permissions from plan content—no file edits happen before approval, while the plan markdown itself includes full technical steps and code.
- **Minimal Mode**: Injects rules within the active agent scope while preserving custom subagent personas and `structured_output` instructions.
- **Subagents**: Background subagents and structured output tasks inherit the current toggle state.
### Structural Fusion & Fallback
The plugin fuses sections structurally by DSH's canonical section names (`deployment:persona-prefix`, `plan:policy`, `tools:ptc-only`, `tool:structured_output`) with idempotency guards, supporting both the latest DSH Web (`0.2.2-rc.3`) and DSH Desktop (`0.2.1-rc.5`) without brittle exact-string hash checks. If a custom preset omits the persona section, it safely falls back to the stock prompt.
### Instant Toggle
The toggle state is saved in the profile's `cordis.patch.yml` and takes effect on the next request without restarting the service. Turning it off restores the stock prompt immediately without leaving markers in session history.
---
## Installation & Updates
## Installation & Usage
```sh
# Install on DSH Web
dsh plugin --profile web add github:yexi-by/dsh-unrestricted#v0.2.14
# Install on DSH Web (GitHub Release or local checkout)
dsh plugin --profile web add github:yexi-by/dsh-unrestricted
dsh plugin --profile web add file:./plugin/unrestricted
# Install on DSH Desktop
dsh plugin --profile desktop add github:yexi-by/dsh-unrestricted#v0.2.14
```
dsh plugin --profile desktop add github:yexi-by/dsh-unrestricted
Restart `dsh web` or DSH Desktop after installing, then follow [Usage](#usage) to enable it.
#### Update
Use the update controls in DSH’s built-in plugin manager, or the CLI commands below. The plugin no longer queries GitHub or runs its own pnpm installer.
```sh
dsh plugin --profile web remove dsh-unrestricted
dsh plugin --profile web add github:yexi-by/dsh-unrestricted#v0.2.14
```
Restart `dsh web` or DSH Desktop.
#### Uninstall
```sh
# Uninstall
dsh plugin --profile web remove dsh-unrestricted
```
### Local Source Install
Restart `dsh web` or DSH Desktop after installing, then enable both the plugin switch under **Plugins** and **"Enable unrestricted mode"** inside its settings card. Additional card features:
For local development:
```sh
dsh plugin --profile web add file:D:/work/dsh/plugin/unrestricted
```
---
## Usage
Make sure both switches are turned on after installation:
1. **Enable Plugin**: Open **Plugins** in the left sidebar, find `dsh-unrestricted`, and turn on the plugin switch.
2. **Enable Rules**: Click `dsh-unrestricted` to open its settings card and turn on **"Enable unrestricted mode"**.
The settings card also provides:
- **Strip Host Brand Identity**: An independent option that removes `DeepSeek Harness` / `DSH` identity sections and Web GUI checkout context from assembled prompts, preventing HTTP `429` client-fingerprinting blocks on third-party routes (applicable to Google Antigravity reverse proxies, Google AI Studio PG channels, etc.).
- **Mode Coverage & Prompt Preview**: Shows active status for Standard, PTC, Cordis, and Minimal modes, with expandable full-prompt preview and one-click copy.
---
## Notes
- **API Gateway Filtering**: System prompts adjust the model's own refusal behavior. If an upstream API gateway enforces external keyword blocking, requests may still be dropped or return HTTP 400 at the network layer.
- **Host Permissions**: The plugin does not alter DSH's file sandbox, command approval prompts, or Plan Mode write protection.
---
- **Strip Host Brand Identity**: Independently removes `DeepSeek Harness` / `DSH` identity sections and Web GUI checkout context to avoid HTTP `429` client-fingerprinting blocks on third-party proxy routes.
- **Mode Coverage & Prompt Preview**: Inspect and copy the full assembled system prompt across Standard, PTC, Cordis, and Minimal modes.
## Development & Testing
```sh
git clone https://github.com/yexi-by/dsh-unrestricted.git
cd dsh-unrestricted
pnpm install
pnpm typecheck && pnpm build && pnpm test
pnpm typecheck
pnpm build
pnpm test
node tools/dump-prompts.mjs --repo <dsh-repo-path> --out tests/fixtures
node tools/verify-live.mjs --repo <dsh-repo-path>
```
Helper scripts:
- `node tools/dump-prompts.mjs --repo <path> --out tests/fixtures`: Exports stock prompts from a DSH source checkout to update test fixtures.
- `node tools/verify-live.mjs --repo <path>`: Verifies assembly and rollback across all four modes locally without calling model APIs.
---
## License & Credits
- Initial prompt rule structure adapted from [Jia-Ethan/codex-keysmith](https://github.com/Jia-Ethan/codex-keysmith) (MIT License). See [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
- Not affiliated with codex-keysmith or its author.
- Prompt rule structure adapted from [Jia-Ethan/codex-keysmith](https://github.com/Jia-Ethan/codex-keysmith) (MIT License); see [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
- Released under the [MIT License](LICENSE).