补充官方创造模式:把内存里试过的小工具插件校验、经 ctx.plugin 热挂、打分后固化到盘上或回滚。
安装
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:shinjiyu/deepseek-harness-evolver
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
官方 创造模式 的原话是:检查当前运行时、在内存中试验 Cordis 插件,并据此组合和创作新的模式。架构是 一切皆插件。
这个控制器是补充,不是替代。官方已经把热挂(ctx.plugin、可逆副作用)做完了。我们补的是试验之后的闭环:信号 → 提案 → 校验 → 本进程挂上 → 打分 → 固化到盘上或回滚。重启还在。
不是「已经自动自进化」。不会改 agent-loop / session / loader。
Host-agnostic controller for evolving tool plugins, plus a DeepSeek Harness bundle that live-mounts a passing trial into the current process.
状态机:
signals → analysis → abstract → stage → validate → mount → score → solidify | rollback
↘ rejected
CLI mount 只写盘。dsh 插件的 evolve_mount 还会 ctx.plugin,新工具立刻出现在本轮会话里。
Install
npm install plugin-evolve
Node >= 18. 零运行时依赖。
Library
import { createController } from "plugin-evolve";
const evolve = createController({ root: process.cwd() });
await evolve.init();
const advice = await evolve.recordSignals([
{ kind: "tool_error", payload: { tool: "bash" } },
]);
const report = await evolve.analysis();
// report.ready = points that should be evolved now
if (advice.shouldPropose || report.ready.length > 0) {
const draft = await evolve.abstract(); // or { stage: true }
await evolve.stage({
manifest: draft.manifest,
files: { "plugin.js": draft.source },
signalKind: draft.signalKind,
});
}
await evolve.validate();
await evolve.mount();
// next process:
const { evolved, trial } = await evolve.loadout();
for (const plugin of [...evolved, trial].filter(Boolean)) {
await import(plugin.entryPath);
}
await evolve.score({ samples: 10, successDelta: 2, retryDelta: -1 });
await evolve.solidify({ confirm: true }); // first 3 keeps need confirm
CLI
npx plugin-evolve init --root .
npx plugin-evolve analysis
npx plugin-evolve abstract
npx plugin-evolve abstract --point tool_error:web_fetch --stage
npx plugin-evolve signal --kind tool_error --json "{\"tool\":\"bash\"}"
npx plugin-evolve stage ./examples/retry-on-429 --signal-kind tool_error
npx plugin-evolve validate
npx plugin-evolve mount
npx plugin-evolve score --samples 10 --success-delta 2 --retry-delta -1
npx plugin-evolve solidify --confirm
npx plugin-evolve loadout
npx plugin-evolve events --tail 20
npx plugin-evolve rollback
所有命令默认打印 JSON。
Layout
<workspace>/.evolve/
state.json
events.jsonl # append-only
mounted.json # at most one in-flight trial
candidates/<trialId>/
abstracts/<pluginId>/ # last abstracted draft
evolved/<pluginId>/v<n>/
同时最多一个 trial。候选必须是扁平目录:manifest.json + 入口 + 可选 README/LICENSE。
Manifest
{
"id": "retry-on-429",
"kind": "tool",
"purpose": "Retry idempotent HTTP calls after a 429 response",
"inject": ["tools"],
"entry": "plugin.js",
"constraints": { "network": false, "shell": false }
}
入口必须导出 apply。控制器不执行这段代码,只做静态检查。
Policy
| 规则 | 默认 |
|---|---|
只允许 kind: "tool" |
是 |
允许的 inject |
["tools"] |
network / shell |
必须 false |
| 体积 | 32 KiB |
| 禁止 | fs / net / http / child_process / eval / new Function |
| 禁止的 id | session loader agent-loop evolve controller plugin-evolve |
| 打分通过 | samples >= 10 且 successDelta > 0 且 retryDelta <= 0 |
| 人工确认 | 前 3 次 solidify 必须 confirm: true |
| 停滞 | 同一 signalKind 连续失败 3 次后拒绝再 stage |
DeepSeek Harness plugin
This package is a dsh.bundle. Install it into a profile and the model gets evolve_* tools. evolve_mount calls ctx.plugin so the new tool is live in the current process.
dsh plugin --profile web add github:shinjiyu/deepseek-harness-evolver
dsh plugin --profile headless add github:shinjiyu/deepseek-harness-evolver
本地路径也可以:dsh plugin --profile web add D:\tempWorkspace\plugin-evolve
Then, in a workspace:
dsh --profile headless "web_fetch 连续 429。用 evolve_signal 记两次,evolve_status 看是否该提案,再 evolve_stage 一个只 inject tools 的重试插件,validate、mount,用新工具打 10 次,evolve_score 后 evolve_solidify confirm=true"
Model-facing tools: evolve_analysis evolve_abstract evolve_status evolve_signal evolve_stage evolve_validate evolve_mount evolve_score evolve_solidify evolve_rollback.
evolve_analysis / CLI analysis 读最近 32 条 signal,按 kind + payload.tool 聚成进化点:ready 可提案,watching 还不够两次,blocked_trial 已够但有进行中的 trial,stagnant 被锁。
evolve_abstract / CLI abstract 从 ready 点抽出一个只 inject tools 的插件草稿(manifest + plugin.js),写到 .evolve/abstracts/<id>/。--stage / stage:true 会直接送进 trial。
Workspace state is <cwd>/.evolve/. Override with PLUGIN_EVOLVE_ROOT or plugin config root.
What this is not
- 不是 EvoMap/evolver,也不连 Hub
- 不会改 agent-loop / session / loader
- 会按信号点抽象出小工具插件草稿,但不会改 agent-loop / 不会替你改业务工程
Case: HTTP 429
模拟宿主里 web_fetch 连续 429。控制器建议写工具插件;宿主挂上 examples/retry-on-429 后按它的 backoff 再打 10 次,用真实成功率打分并固化。
npm run case:429
Develop
npm install
npm test
Repo: shinjiyu/deepseek-harness-evolver · 介绍帖:Show and tell #1720
链接
同类插件
yjh051108/dsh-routing-suite★ 7003
一个仓库三件套:DSH 插件包的运行时注入器(注入、热重载、卸载、开发侧挂区一键转正、路由自愈,外带设置页插件管理:列出、卸载、拖入文件夹内化)、任务感知的思维模式路由 agent 预设(router-standard / router-spec / router-react)、以及分级两级任务协议(commit_star / lock_stage / revise_do / edit_plan / mark_task / redteam_verdict 六个工具,任务状态落盘)。注入器实现直接在库内,安装的是它自己的行为而不是一份依赖清单。
strukto-ai/mirage#dsh★ 3666
把文件系统与 bash 提供者换成 mirage 虚拟工作区:文件工具与 shell 命令作用于挂载的资源(RAM、S3、Redis、Slack、Gmail、Notion、Postgres)而非宿主磁盘,支持按挂载点设置读/写/执行模式、按命令选择沙箱(进程内 monty、pyodide、quickjs;远程 docker、e2b、daytona),并可在虚拟终端中安装 CLI(git、gh、slack、linear、ntn、gws,或自行注册的程序树)作为命令头词。
hust-open-atom-club/oh-dsh★ 325
社区发行版:TUI、桌面端与 Web UI 统一体验,分层安装、一步到位。
weijiafu14/pi2dsh★ 206
Pi Host ABI 兼容引擎:装一次之后,npm 上的 Pi 扩展原包经 `dsh plugin add <pi-package>` 直接作为 DSH 原生插件挂载。已在官方 DSH 上端到端验证 pi-mcp-adapter(完整 MCP 管理面:OAuth、resources、prompts、MCP Apps、elicitation、sampling)、@tintinweb/pi-subagents、pi-code、pi-hermes-memory、pi-background-tasks;`pi2dsh inspect` 在安装前报告一个包的兼容情况。
lire1131/dsh-undo-savepoint★ 166
DSH 撤销/回退系统:配置变更自动存档,一键撤销/恢复/回退到任意版本,支持 WebUI 与离线 CLI/GUI 工具(DSH 启动失败也能救)。
Fishquito7/dsh-skill-mcp-panel★ 155
在 DSH Web 设置中管理技能与 MCP 服务器:技能卡片热启停、工作区作用域、分组、批量迁移与拖拽导入,以及 stdio/HTTP MCP 增删改查、连接测试、密钥脱敏,并附带统一 dsh-panel 命令行。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。