LoserFox/distill 预览 preview

LoserFox/distill

自动对话蒸馏:后台子代理反思与技能创建/更新

Project Overview项目介绍

This is a native plugin built exclusively for DeepSeek Harness (DSH), focused on enabling automatic in-background conversation reflection and reusable skill distillation from ongoing DSH sessions. To install the plugin, users run the DSH CLI command dsh plugin --profile <your-target-profile> add <this-repo-git-url>, then verify the installation by dumping the DSH config and checking for the distill entry. After installation, users must restart the DSH process running the target profile, since bundle changes do not support hot module replacement in DSH. The plugin does not register any user-facing or model-facing tools or skills, instead it hooks into DSH’s turn-stopping event to run its background logic.

The plugin follows a straightforward workflow: after each conversation round ends, it accumulates all new user messages since the last reflection checkpoint. Once the number of accumulated new messages hits the configured minimum threshold (default 3 messages), it spins up a restricted background reflection sub-agent to analyze the conversation content. The sub-agent can output one of three results: skip reflection if there is no useful content to extract, create a new skill saved as a SKILL.md file, or update an existing skill that was previously distilled by this plugin. Only skills that carry the plugin’s ownership frontmatter marker can be updated, to avoid overwriting user-written or built-in skills.

For the plugin to function correctly, two DSH base bundle plugins must be enabled and available: subagent-spawn-in-process which provides the default sub-agent spawner, and tool-skill which lets the reflection sub-agent view existing skills. The reflection prompt used by the plugin is adapted from the Hermes Agent project by Nous Research, used under the terms of the MIT license. There are multiple documented limitations in the current release, including full-file only updates, in-memory only checkpoints, and only one concurrent reflection process per active DSH session.

这是一个原生DeepSeek Harness(DSH)插件,核心功能是自动对话反思和技能蒸馏。它通过DSH命令行工具安装,执行dsh plugin --profile <profile名称> add 本仓库的Git地址即可完成安装,安装后需要重启对应配置文件的DSH进程生效。该插件挂载在agent/turn-stopping钩子上,仅在后台运行反省逻辑,不注册任何面向模型或用户的工具技能。

每个对话回合结束后,插件会收集自上次检查点以来新增的用户消息。当消息数量达到配置阈值(默认3条)后,它会派生出一个后台反省子代理,对对话内容进行整理提炼,最终生成新技能文件,或是更新之前由该插件蒸馏出的已有技能,结果保存为本地SKILL.md文件供DSH加载识别。该插件面向希望从对话历史中自动积累可复用技能的DSH用户开发。

插件依赖DSH基础包中默认自带的两个插件才能运行:subagent-spawn-in-process和tool-skill。其反省提示词改编自Nous Research的Hermes Agent项目,遵循MIT许可证。该插件目前存在多个已知限制:仅支持整文件更新、检查点仅保存在内存中、每个会话同一时间仅能运行一个反省进程。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • No license declared - all rights reserved by default; ask the author before commercial use or redistribution未声明开源许可证 —— 默认「保留所有权利」,商用或再分发前先问作者
  • 28 stars - an early-stage project星标 28,属于早期项目
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add github:LoserFox/distill

把 LoserFox/distill 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

distill

安装(DSH profile bundle)

# 从本仓库 checkout 安装到 profile(web / headless 等),bundle 声明自动加入组合层
dsh plugin --profile web add <目录|git-url>
# 验证
dsh --profile web --dump-config | grep distill
  • 插入行 id:distill(cordis.patch.yml);不注册任何面向模型的工具或技能——它只挂接 agent/turn-stopping 并运行后台反省。
  • 宿主前提:dsh 组合必须挂载 subagent-spawn-in-process(注册反省子代理使用的 spawn 子代理提供方)与 tool-skill(子代理可调用的 skill 查看器)——两者在 base bundle 中默认存在。
  • 卸载:dsh plugin --profile web remove distill。
  • 安装后需重启目标 profile 的 DSH 进程(组合层变更不参与 HMR 热更新)。

概述

自动对话反思与技能蒸馏。

需要 ctx.subagents(inject: ['subagents'])以及已注册的子代理提供方——subagent-spawn-in-process 插件注册了默认的 spawn 提供方——并且部署中包含面向模型的 skill 工具(tool-skill),反省子代理才能查看技能。反省提示词改编自 Nous Research 的 hermes-agent _SKILL_REVIEW_PROMPT(MIT 许可,Copyright (c) 2025 Nous Research),针对本界面做了改写;完整署名见源文件头。

行为

每个回合完成(agent/turn-stopping 触发)时,插件会收集自上次蒸馏检查点以来新增的人类 user/message 事件;数量达到 minUserMessages 后,派发一个后台反省子代理(Hermes Agent 后台反省的形态:受限工具集的全新子代理,在回合之后运行,从不与用户任务争抢)。子代理的提示词携带 Hermes 策展课程、消息窗口帧和可更新技能列表;其工具集白名单只保留 skill 查看器,最终答案通过结构化输出契约捕获。派发前会发出非持久化的 Cordis distill/review-request 通知,携带精确的路由、提示词、工具白名单和 token 上限;该通知不会写入会话日志。

反省子代理提议以下之一:

  • {"action": "skip"} — 无值得保存的内容;本轮结束。
  • {"action": "create", "skill": {"name", "description", "whenToUse?", "content"}} — 一个新技能,写成带 frontmatter 的 SKILL.md 包,本地技能提供方会像发现手写技能一样发现它。
  • {"action": "update", "skill": {...}} — 对某个先前蒸馏出的技能的完整替换。

每个提议都会经过校验(通过 isSkillName 校验 kebab-case 名称,描述和内容非空)。目标文件已存在时 create 被跳过。只有目标文件存在且带有插件 distilled-by: dsh-distill frontmatter 所有权标记时 update 才会被应用;缺失或非蒸馏所有的目标会跳过并记录警告,因此用户手写、内置和运行时注册的技能永远不会被重写。蒸馏出的文件都带该标记,且只有带标记的技能会出现在子代理的可更新列表中。无论结果如何,检查点都会推进到最后一条已反思消息,因此每轮只覆盖新消息。

反思目标优先使用显式配置的 provider/model 对(两者需同时配置),否则使用已结束 agent 自身的 agent.options 路由。两者都不存在时本轮跳过并记录警告。子代理运行在 providerName 指定的子代理提供方上;提供方缺失、或运行失败、被取消、无捕获结果时只记录警告,绝不会使循环崩溃。

配置

字段 默认值 含义
enabled true 总开关。
minUserMessages 3 触发一次反省所需的新增人类用户消息数。
provider / model 未设置 显式辅助路由;必须同时提供。默认使用 agent 自身路由。
maxTokens 2048 反省子代理输出 token 上限。
timeoutMs 30000 反省的端到端截止时间。
targetRoot project project 写入 <git-root>/.agents/skills;user 写入 ~/.agents/skills。
providerName spawn 反省子代理使用的子代理提供方注册名。
allowUpdate true 是否允许反省更新先前蒸馏出的技能;false 时只提供 create。

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-plugin-directory 下一个 Next dsh-im-connect →