jonah791/dsh-compact-provider

DSH 插件生态公约声明(plugin-ecosystem-convention · 组合优先/声明清晰/兼容优先) purpose: 压缩入口插件:挂载 AgentCompactEngine 为宿主 compaction 服务 + sessioncompact 显式入口工具(爱丽丝自主决策压缩) inject: 'agents','tokenMeter','sessions','tools' tools: sessioncompact runtime: host-only

catalog descriptioncatalog 简介 / catalog description:压缩一体化插件:AgentCompactEngine 挂载 compaction 服务 + session_compact 工具原语(爱丽丝自主决策压缩)

Project Overview项目介绍

This is a native plugin built exclusively for the DeepSeek Harness (DSH) environment. It mounts the independently developed dsh-agent-compact compression engine as the compaction service for the DSH host, and registers the session_compact tool primitive that lets the AI agent independently decide when to run compression, with no forced triggers from the framework itself. To install, you need to link this package as a dependency in DSH's self-plugins directory, add the preset entry to your DSH configuration, and run it alongside the dsh-agent-compact package, as running this plugin alone will throw an error due to the missing compaction engine dependency.

The plugin handles entry constraint checks, automatic best-effort archiving before compression runs, and full trace logging of all compression requests. It does not handle the actual compression process itself, which is managed entirely by the linked dsh-agent-compact engine, and it does not include any timer or threshold-based automatic compression triggers. All compression decisions are left to the AI agent, which calls the session_compact tool with a required reason parameter to document the decision before starting the compression process. If the checkpoint service is unavailable or archiving fails, the plugin will not block the compression process, it will only log a warning and proceed, as compression can be retried later after the error is resolved.

All request phase data is saved to the compaction-trace.jsonl file in the DSH_HOME directory, and users can query the log with a simple grep command to check the status of past compression requests. The plugin is released under the MIT open source license, and includes 33 offline test cases that cover core functions like constraint checks, trace logging, and dependency validation. To verify the plugin is working correctly after installation, you can run the included test suite with the npm test command, and check for the expected output entries in the trace log.

这是一个专为 DeepSeek Harness(DSH)开发的原生插件,作用是将自研的 dsh-agent-compact 压缩引擎挂载为 DSH 宿主的 compaction 服务,同时注册 session_compact 工具原语,允许 AI 代理自主决策压缩时机,框架本身不做强制触发。插件遵循 DSH 插件生态公约,依赖 cordis ^4.0.1 和 dsh-tools ^0.1.0-rc.6,仅运行在宿主环境,无额外环境依赖,纯 Node.js 逻辑实现。

插件核心能力包括入口约束校验、压缩前自动 best-effort 存档、请求全链路留痕,不负责压缩事务本身,也不做自动定时触发压缩,什么时候压缩完全由 AI 代理自主决定。安装时需要将本插件和 dsh-agent-compact 一同挂载在 DSH 的 self-plugins 目录,并在配置文件中添加对应预设行,单独启动本插件会因为缺少引擎依赖报错。

本插件使用 MIT 许可,支持用户在项目约定内自由使用修改,每次调用 session_compact 工具前都会自动生成一份健康检查点存档,所有请求的阶段状态都会落盘到 DSH_HOME/compaction-trace.jsonl 便于追溯。用户可以通过 grep 命令查询调用记录,确认插件是否生效,修改引擎代码后需要同步更新本插件的依赖副本才能正常运行。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 3 warnings3 项注意
  • No license declared - all rights reserved by default; ask the author before commercial use or redistribution未声明开源许可证 —— 默认「保留所有权利」,商用或再分发前先问作者
  • Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
  • No DSH plugin manifest detected - it may only carry the dsh-plugin topic, so the install method must be confirmed on the spot未检测到 DSH 插件清单:可能只是打了 dsh-plugin 话题,安装方式要现场确认
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:jonah791/dsh-compact-provider

把 jonah791/dsh-compact-provider 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-compact-provider — 压缩入口(挂载 + 显式工具)

version license tests

一句话:把自研压缩引擎(dsh-agent-compact)挂成宿主 compaction 服务,并注册 session_compact 工具——压缩何时发生由 agent 自主决策,框架零强制。

为什么值得用:引擎是压缩事务的执行者,本插件是它的入口与门房——管前置判据、管决策留痕。主路径其实不需要这个工具:在任意一轮输出里直接写 checkpoint 块即可(零额外请求);工具是「不想把 checkpoint 写进正文」或「需要显式可控入口」时的第二入口。

⚠ 本插件与引擎是回退对(provider 0.3.0 ↔ 引擎 0.2.1),同进同退,禁止单侧回退。

定位与反定位

  • 管:入口约束(summary 必填 → compaction seam 在位 → agent 上下文在位)、显式入口、请求侧留痕。
  • 不管:压缩事务(识别/换血/幂等 → 引擎);压缩前存档(→ 引擎,2026-09-27 移交);「什么时候压」的决策(→ agent 自主,本插件只提供原语)。
  • 不是自动压缩:本插件无任何定时器/阈值触发。

能力

面 内容
工具 session_compact——参数 summary(必填,checkpoint 正文)、reason(决策留痕)。与标记路径共用同一事务
服务 挂载 AgentCompactEngine 为宿主 ctx.compaction
留痕 请求侧四阶段写 <DSH_HOME>/compaction-trace.jsonl(与引擎共用一个文件)

快速开始

# 预设行(与引擎成对挂载)
- id: compact-provider
  name: dsh-compact-provider
  config:
    enabled: true
    minCheckpointChars: 200

安装走 self-plugins/ link 依赖 + 预设行(详见生态中心仓)。必须与 dsh-agent-compact 同挂同停——provider 单独拉起会在 seam 缺失时报错。

配置

复用引擎的 CompactConfig schema(只有两项:enabled 与 minCheckpointChars,全表见引擎 README 与 docs/semantic.md §4.1)。本插件自身无独立配置——这是刻意的:入口与引擎共享同一批裁决参数,不存在两处漂移。

⚠ 引擎 0.2.0 起旧策略键已全部删除(thresholdRatio / retainRatio / auto / modelPolicies …)。组合里留着旧键会装载失败——升级时先清 config。

落盘与自证

每次 session_compact 调用,请求侧落这些阶段(与引擎侧 detected→committed / rejected / abort 按 atMs 天然 join 成一笔):

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-skin-studio 下一个 Next specpowers →