DSH HUB
首页插件商店插件包社区排行榜资源发布指南
插件源码
返回插件目录

rj-yejianping /

rj-yejianping/dsh-infinite-gen-4-session-only

仅 Topic 仓库

Session-scoped armor preset for DeepSeek Harness (DSH). Fixes the installer for DSH >= 0.2.2, where presets are loader rows declared through the profile patch instead of $DSH_HOME/.agent-presets/<id>/.

★ 0 Stars0 Forks0 IssuesN/A 社区评分0 已确认安装
查看 GitHub
README来源: main@e9e75078

dsh-infinite-gen-4-session-only

把「无限四代」armor 提示词插件做成会话级能力:只有你在新建会话时选了 「无限四代 (armor) · 可开关」这个预设,插件才生效;其它会话完全不加载它。

⚠️ 这是红队 / 评测工具:提示词会显著降低模型拒绝行为,评分器还会统计回复里的 拒绝与回退。请只在获授权的测试环境使用。

本仓库是 OHCJ099/dsh-infinite-gen-4-session-only 的修复版:安装方式适配 DSH ≥ 0.2.2(预设从「目录」改成了「loader 行」),插件本体 plugin/ 未改动。


为什么安装方式要改

DSH 0.2.2 起,$DSH_HOME/.agent-presets/<id>/ 不再被读取——安装包里 @deepseek-ai/dsh-agent-preset/skills/dsh-doc/references/compositions.md 的原话是:

Before declaration rows, a user preset was a directory $DSH_HOME/.agent-presets/<id>/ ... Nothing reads that directory any more.

现在的预设是普通 loader 声明行(@deepseek-ai/dsh-agent-preset + config),由 patch 文件插入。 官方自带预设就在 @deepseek-ai/dsh-web-app/presets/{standard,ptc,minimal,cordis}.patch.yml。

所以本仓库的安装脚本:

  1. 复制 plugin/ 到 $DSH_HOME/plugins/dsh-infinite-gen-4/;
  2. dsh plugin --profile <p> add file:<该目录> 登记依赖(普通依赖,故意不声明 dsh.bundle, 否则 DSH 的 reconcilePlugins 会把它提升成进程级全局插件);
  3. 找到本机安装的自带预设 ptc(找不到再退 code/standard,最后用仓库内快照), 派生出一个 preset-armor 行(config.id: armor),把 dsh-infinite-gen-4 追加进它的 config.plugins,整块写进 $DSH_HOME/profiles/<p>/cordis.patch.yml 的托管块里。

托管块用 # >>> dsh-infinite-gen-4 armor preset (managed) >>> / # <<< ... <<< 包住, 重复安装只会替换这一块,不会动你 profile 里的其它配置。


安装

要求:dsh 与 node 都在 PATH 中(DSH 自带 Node),且目标 profile 已存在(启动过一次 DSH)。

Linux / macOS

git clone https://github.com/rj-yejianping/dsh-infinite-gen-4-session-only.git
cd dsh-infinite-gen-4-session-only
./install.sh                      # 默认 profile=web,home=~/.dsh
# 或
./install.sh --profile web --dsh-home ~/.dsh

Windows(PowerShell)

git clone https://github.com/OHCJ099/dsh-infinite-gen-4-session-only.git
cd dsh-infinite-gen-4-session-only
powershell -ExecutionPolicy Bypass -File .\install.ps1
# 或
powershell -ExecutionPolicy Bypass -File .\install.ps1 -Profile web -DshHome C:\Users\me\.dsh

参数

参数 说明
--profile <id> / -Profile 目标 profile,默认 web
--dsh-home <dir> / -DshHome DSH home,默认 $DSH_HOME 或 ~/.dsh
--legacy / -Legacy 旧版 DSH(< 0.2.2)才用:写 .agent-presets/armor/
--skip-register / -SkipRegister 跳过 dsh plugin add(插件已登记过)

脚本最后会自检三件事,任何一件不满足都会报错退出:

  • dump-config 里有 preset-armor 行;
  • 顶层没有 - id: dsh-infinite-gen-4(有就是全局常开,属于错误安装);
  • preset-armor 的 config.plugins 里确实有 dsh-infinite-gen-4。

怎么配置(重点)

1. 没有 config.yaml 开关 —— 开关就是「选不选这个预设」

armor 是否生效不由任何配置文件控制,而是由会话的预设决定:

  • 新建会话时,在预设选择器里选 「无限四代 (armor) · 可开关」 → 该会话注入 armor 提示词、infinite_gen4_profile 工具和拒绝率计分器;
  • 选其它预设(standard / ptc / minimal …)→ 完全不加载。

2. 已有会话不会切换

预设是建会话时定的。装完后请新建会话并选它;旧会话保持原样。

3. 验证是否生效

dsh --profile web --dump-config | grep -n 'id: preset-armor'
dsh --profile web --dump-config | grep -nE '^- id: dsh-infinite-gen-4'   # 应无输出

会话里可以看两点:

  • 系统提示词里出现 armor 提示词(新建 armor 会话后问它「你现在是什么模式」也能看出);
  • 侧栏/会话头出现 armor 状态条(插件自带 sessionProjections 的 armor 投影,含 通过/拒绝/回退计数)。

4. 改名字、描述、排序

直接改 $DSH_HOME/profiles/<p>/cordis.patch.yml 托管块里的 name: / description: / order:(order 决定预设选择器里的排序,官方 ptc 是 2,默认 9)。 改完刷新页面即可,不用重装。

5. 改提示词

plugin/prompts/infinite-gen-4.md(主提示词)与 plugin/prompts/infinite-gen-4.1-flash.md (flash 路由提示词)是纯文本,改完重跑 install.sh(或手动把文件同步到 $DSH_HOME/plugins/dsh-infinite-gen-4/prompts/)并重启 DSH 即可。

6. 改评分规则

判定逻辑在 plugin/index.js:REFUSAL_MARKERS_ZH、REFUSAL_MARKERS_EN、 FALLBACK_MARKERS、RISK_MARKERS、DOMAIN_MARKERS。改完同样同步到插件目录并重启。

7. 只装到某个 profile

DSH 每个 profile 有独立的 profiles/<id>/cordis.patch.yml。要装到别的 profile 就 ./install.sh --profile <id>;不想让 web 生效就别在 web 上装。


卸载

./uninstall.sh [--profile web] [--dsh-home ~/.dsh]

做三件事:删托管块(老版本目录也删)、dsh plugin remove dsh-infinite-gen-4、 删 $DSH_HOME/plugins/dsh-infinite-gen-4。Windows 用 uninstall.ps1。


目录结构 / 相对上游的改动

install.sh / install.ps1        改写:多一步「声明预设行」,多一步验证
uninstall.sh / uninstall.ps1    改写:清理托管块 + 注销依赖
scripts/armor-preset.mjs        新增:定位自带预设、派生 preset-armor、写托管块(apply/remove/status)
preset/agent-preset.patch.yml   新增:自带 ptc 预设的 armor 版快照,找不到自带预设时兜底
preset/agent.cordis.yml         仅 --legacy 用(旧版 .agent-presets 目录)
preset/preset.yml               仅 --legacy 用
preset/armor-row.yml            仅 --legacy 用
plugin/                         未改动(插件本体,含 prompts/)

scripts/armor-preset.mjs 是零依赖的 Node 脚本,也支持单独查询:

node scripts/armor-preset.mjs status --profile web --dsh-home ~/.dsh

常见问题

dsh: command not found / 找不到 node 装脚本要求 dsh、node 在 PATH。Node 全局安装的 DSH 一般两者都有;Windows 上确保 %APPDATA%\npm 在 PATH。

dump-config 有 preset-armor,但界面上没有这个预设? 刷新页面或重启 DSH Web;预设列表在建会话弹窗里,不在全局设置里。

dump 顶层出现 - id: dsh-infinite-gen-4? 那是把插件声明成了全局行(插件变成进程级常开,不再会话级)。删掉该行,重跑 ./install.sh --skip-register。

升级 DSH 之后预设不见了 / 报错? 自带预设的 patch 结构可能变了。重跑 ./install.sh --skip-register 会按当前 DSH 的 ptc.patch.yml 重新派生托管块(脚本会打印它用的是哪个文件);如果打印的是仓库内快照, 说明没找到自带预设,检查 dsh 的安装路径或设置 DSH_WEBAPP_PRESETS_DIR。

pnpm 安装阶段报 file: 依赖 / approve 相关 DSH 的 profile 用 pnpm 管理依赖;报错时看脚本打印的 pnpm 输出,必要时在 $DSH_HOME 里执行 pnpm approve --all(Web profile 有时把依赖放进 permissions.dsh-browser-cdp.skills)。

和 billion-context 一起用 billion-context 的 compaction gate 会在运行时把预设里 compaction-basic / command-compact 行改成 disabled,并把主平面的 compaction-basic 设成 auto: false; armor 预设不需要额外处理,两者可以共存。

旧版 DSH(< 0.2.2) 用 ./install.sh --legacy:仍写 $DSH_HOME/.agent-presets/armor/{agent.cordis.yml,preset.yml}, 由旧版 loader 读取。


许可

  • plugin/ 来自 Minglink/dsh-infinite-gen-3(MIT), 本仓库仅调整安装/预设声明方式;
  • 其余文件(安装脚本、scripts/armor-preset.mjs、预设快照、README)同为 MIT,见 LICENSE。
—/ 5

暂无评分

需要先验证清单

Commit e9e75078e4f1

社区评论

还没有评论,来写第一条。

DSH HUB

社区维护的 DSH 插件索引。不是 GitHub 或 DeepSeek AI 的官方产品。

社区资源API关于