Files
dsh-purge/package.json
T
叫我小杨同学andClaude f79363a17e fix: cordis.patch.yml 为 [] 时替换而非追加,修复宿主启动解析失败(#191)
宿主生成的 profile 层 cordis.patch.yml 可能整体只有一个空 flow 序列 [],
那本身就是一个完整 YAML 文档。旧实现无条件在文件尾追加 `- insert:`,
结果是第二个文档,宿主启动解析报
"end of the stream or a document separator is expected" 直接崩掉
(macOS DSH Desktop 0.2.1-rc.4)。

- 新增 classifyPatchBody() 判断数据部分形态:empty / empty-flow /
  block-seq / flow-seq / unknown,只看最后一个文档的根节点
- 空 flow 序列([] 或 [ ],可带 --- 前缀)→ 把整行替换成 insert 块,
  绝不追加成第二个文档
- 空文件 / 只有注释和空行 → 写 insert 块,注释保留
- 正常块序列 → 沿用旧的追加行为,前导空行规则不变
- 非空 flow 序列(宿主/用户内容)以及认不准的形态 → 不动,
  返回 { ok: false, wrote: false },宁可留着也别写坏
- postinstall 脚本区分「跳过」和「已有」,跳过时打印说明
- profileHasPurgeBodyInsert() 检测逻辑未动
- 新增 9 条用例(形态分类 / 空文件 / 只有注释 / 注释+[] / ---+[] /
  块序列追加 / 非空 flow 不写 / 已有本体行零写入 / 替换后幂等),
  版本 1.1.83

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-30 12:26:23 +08:00

99 lines
2.6 KiB
JSON

{
"name": "dsh-purge",
"version": "1.1.83",
"description": "DeepSeek Harness 破甲:让所有模型都能破甲,不同模型可换不同提示词;默认提示词面向国模「小码酱」。Jailbreak for every model — swap prompts per model. 求 Star 收藏 ⭐ 如要二开,请查看署名要求部分",
"type": "module",
"main": "lib/index.js",
"exports": {
".": {
"default": "./lib/index.js"
},
"./client": "./client.js",
"./redteam": "./lib/redteam/index.js",
"./redteam/store": "./lib/redteam/store.js",
"./redteam/ui": "./lib/redteam/ui.js",
"./redteam/tools": "./lib/redteam/tools.js",
"./package.json": "./package.json"
},
"bin": {
"dsh-purge": "bin/dsh-purge.js"
},
"files": [
"lib",
"!lib/default-prompt-inject.md",
"bin",
"docs",
"presets",
"scripts",
"client.js",
"cordis.patch.yml",
"screenshots.json",
"README.md",
"README.zh-CN.md",
"LICENSE",
"NOTICE"
],
"scripts": {
"embed-prompt": "node scripts/embed-default-prompt.mjs",
"build:client": "node scripts/build-client.mjs",
"postinstall": "node scripts/ensure-profile-bundle.mjs",
"test": "node --test"
},
"license": "Apache-2.0",
"keywords": [
"dsh",
"dsh-plugin",
"dsh-plugins",
"网络安全",
"红队评测",
"llm-security",
"harness-security",
"deepseek-harness",
"red-team",
"instructions",
"rules",
"prompt-eval",
"agent"
],
"repository": {
"type": "git",
"url": "git+https://github.com/YuJunZhiXue/dsh-purge.git"
},
"homepage": "https://github.com/YuJunZhiXue/dsh-purge#readme",
"bugs": {
"url": "https://github.com/YuJunZhiXue/dsh-purge/issues"
},
"dsh": {
"bundle": {
"patch": "./cordis.patch.yml"
},
"client": {
"platform": "web",
"inject": [
"@deepseek-ai/dsh-client-connection",
"@deepseek-ai/dsh-client-runtime",
"@deepseek-ai/dsh-client-locale",
"@deepseek-ai/dsh-client-ui-slots",
"@deepseek-ai/dsh-client-ui-settings",
"@deepseek-ai/dsh-client-ui-conversation"
]
},
"install": {
"preferred": "tarball",
"tarball": "https://codeload.github.com/YuJunZhiXue/dsh-purge/tar.gz/refs/heads/master",
"zip": "https://codeload.github.com/YuJunZhiXue/dsh-purge/zip/refs/heads/master",
"git": "https://github.com/YuJunZhiXue/dsh-purge.git"
}
},
"publishConfig": {
"access": "public"
},
"peerDependencies": {
"@deepseek-ai/cordis": "^4.0.1"
},
"engines": {
"node": ">=18"
},
"dshTarget": "0.2.1-rc.2"
}