dsh-chat-preset
给 DeepSeek Harness (DSH) 的「聊天模式」Agent preset:一个只会聊天、按需手动联网搜索的会话模式。
- 模型工具面只有
web_search和web_fetch,没有文件、终端、代码执行、子 Agent、定时任务。 - 默认不联网;只有你明确要求搜索/读网页时才联网。
- 每个会话 50000 token 的有效上下文窗口(可改),接近上限时自动走 DSH 自己的
/compact。 - 系统提示词为独立人设(
complete: true),不注入编码 Agent 的说明和工作区上下文。
GitHub 仓库:https://github.com/550AW/dsh-chat-preset
安装(推荐:交给 Agent)
- 从 https://github.com/550AW/dsh-chat-preset/releases 下载最新的 release zip 并解压,
或者
git clone本仓库,得到dsh-chat-preset/文件夹。 - 把这个文件夹的路径交给任意 DSH Agent,说一句:
「按这个目录里的 AGENT-INSTALL.md 安装聊天模式:
<路径>」 - Agent 会读取 AGENT-INSTALL.md,调用
plugin_manager的install_bundle,再提示你重启 DSH。
整个文件夹是自包含的:不需要联网、不需要 npm/pnpm,也不需要手改 profile 文件。
安装(手动)
在任意一个已运行的 DSH 会话里:
plugin_manager({ action: "install_bundle", target: "<解压/克隆后的绝对路径>" })
然后重启 DSH 桌面版。在模式选择器里选择「聊天模式」。
为什么不需要 npm/pnpm
install_bundle 会把本文件夹作为链接依赖装进当前 profile(写入 profile 的
package.json 依赖和 dsh.profile.bundles),因此 profile 的 node_modules/ 里会出现
指向本文件夹的链接。cordis.patch.yml 里 context-guard 行的 name 就是本包的包名
dsh-chat-preset,它通过这个链接按 package.json 的 exports["."] 解析到
plugin/index.js,所以解压到任意路径、换机器、用 release zip 或 git clone 都能工作。
这一行不能写成相对路径(
./plugin/index.js)或绝对file:URL:preset 里嵌套的 行名不会被 patch 加载器锚定,而是按当前 profile 目录解析,相对路径会导致整行导入失败, 界面显示context-guard (...): never started。
配置
全部在 cordis.patch.yml,改完重启 DSH:
| 想改什么 | 改哪里 |
|---|---|
| 有效上下文窗口(token) | context-guard.config.contextWindow(默认 50000) |
| 何时开始压缩 | context-guard.config.compactRatio(默认 0.95) |
| 系统提示词 | persona.config.prefix |
| 搜索条数 / 抓取长度 | tool-web.config 下的 searchMaxResults、fetchMaxOutputChars 等 |
注意:文件头的说明文字由 build.js 保留,正文由 build.js 重新生成;
直接手改正文后如果又跑 build.js,手改会被覆盖。
目录结构
dsh-chat-preset/
├── AGENT-INSTALL.md 给 Agent 的安装说明(先读这个)
├── README.md 这份说明
├── package.json bundle 清单(name: dsh-chat-preset,dsh.bundle.patch 指向下面的 patch)
├── cordis.patch.yml Loader patch:注册 preset 及其插件组合
├── build.js 由脚本重新生成 cordis.patch.yml
├── icon.svg 图标
├── docs/
│ ├── DETAIL.md 明细(英文)
│ └── DETAIL.zh.md 明细(中文)
├── locale/
│ ├── en.json
│ └── zh.json
├── plugin/
│ ├── index.js context-guard 插件(由包名 dsh-chat-preset 引入)
│ ├── schemastery.js 自带的 schema 实现(无外部依赖)
│ └── tests/
│ ├── adversarial.mjs 恶意输入/边界用例(纯 Node,无需 DSH)
│ ├── preset-check.mjs 解析 patch、校验每一行配置
│ ├── mount-check.mjs 用零依赖替身加载 preset 组合
│ ├── loader-check.mjs 用 DSH 自己的 Loader 加载
│ └── run.mjs context-guard 行为测试
└── scripts/
├── selfcheck.mjs 一条命令跑完下面几步
├── static-check.mjs 静态检查 manifest 与 patch
├── run.mjs 插件行为测试(假的 harness 服务)
├── extract-app-asar.mjs 从 app.asar 解出 harness 依赖树
└── simulate.mjs 真实挂载路径:模拟安装后的 profile,逐行导入 + auditRows
测试与自检
在包目录里跑(纯 Node,不需要启动 DSH;Node ≥ 22):
node scripts/static-check.mjs # manifest 与 patch 文本检查
node scripts/run.mjs # context-guard 行为(假 harness 服务)
node --expose-internals scripts/simulate.mjs # 真实 Loader 挂载:逐行导入 + auditRows
node --expose-internals scripts/selfcheck.mjs # 一条命令跑完以上全部
node plugin/tests/adversarial.mjs # 恶意配置/事件/边界用例
scripts/simulate.mjs会在临时目录里搭一个「已安装」的 profile(链接依赖 + node_modules 链接 +dsh.profile.bundles),再用 DSH 自己的cordis-plugin-loader挂载 preset, 逐行导入并跑auditRows;全部通过时输出ALL PASS (real)。 它需要app-asar-dsh/(由scripts/extract-app-asar.mjs从已安装的 DSHresources/app.asar解出;已在.gitignore里)。也可用--bundle-dir指向别的解包目录, 或用环境变量DSH_APP_ASAR指定app.asar路径。- 两个负向对照故意失败,退出码非零:
--raw把context-guard行改回./plugin/index.js,应报ERR_MODULE_NOT_FOUND并出现never started;--break-manifest弄坏package.json,应报ERR_INVALID_PACKAGE_CONFIG。 selfcheck.mjs依次跑 static-check、run.mjs,必要时解包app.asar(首次解到app-asar-dsh/,约 230 MB,已在.gitignore里),最后跑 simulate;全部通过时输出ALL PASS (selfcheck)。plugin/tests/preset-check.mjs与plugin/tests/mount-check.mjs需要 DSH 安装目录 (DSH_INSTALL_DIR),不属于上面的纯 Node 默认路径。
卸载
plugin_manager({ action: "remove_bundle", target: "dsh-chat-preset" })
然后重启 DSH。
版本
1.4.2 — 修复「安装后聊天模式里 context-guard 显示 never started」:context-guard 行
不再用相对路径,而是用本包包名 dsh-chat-preset(通过 profile 的 node_modules 链接
解析到 plugin/index.js),release zip / git clone 装到任意路径都可加载;修复自带
schemastery.js 对 undefined/null 配置不填充容器默认值的问题(Config() 现在
返回完整默认值);scripts/simulate.mjs 重写为模拟「已安装 profile」的真实挂载路径;
新增 plugin/tests/adversarial.mjs 恶意输入用例;文档改为 GitHub 安装流程。
1.4.1 — 把 package.json 的 name 从 @local/dsh-chat-preset 改为 dsh-chat-preset
(去掉包内私有 scope,便于发布到 GitHub)。加载器按包名解析,带 scope 的名字会落到
npm 上导致整包加载失败,因此这是发布前的必要修正。
1.4.0 — 自检补全:scripts/selfcheck.mjs 一条命令跑完静态检查、守卫行为测试
(scripts/run.mjs)、真实挂载路径(逐行导入 + auditRows);任何一个子步骤
退出非零(哪怕是崩了没来得及报)都会让整次自检失败。
1.3.1 — 修复 package.json:它曾是一份带 " <- BROKEN" 标记和多余逗号的失效 JSON,
导致 Loader 读包时抛 ERR_INVALID_PACKAGE_CONFIG,preset 里所有插件行都加载失败。
1.3.0 — 改为可移植安装:context-guard 由 @local/dsh-chat-preset link 依赖改为相对路径行,
包名去掉 @local 作用域,可解压到任意位置直接安装。
Marketplace listing
This plugin is listed in awesome-dsh-plugin under the category session:
Adds a chat-only agent preset (Chat Mode) to DeepSeek Harness with only web_search and web_fetch tools, a 50k-token effective context guard and automatic compaction.
The entry file lives in this repository as dsh-chat-preset.yml so the catalogue text stays reviewable next to the code; the copy submitted upstream is data/plugins/550AW__dsh-chat-preset.yml. Description changes start in that file.
No comments yet. Be the first to write one.