JohnathonYe/auto-compact
Project Overview项目介绍
dsh-auto-compact is a DeepSeek Harness plugin for session-level auto context compaction. It renders a threshold ring beside the input that shows live context usage, and each session can set its own threshold (1%–90%, default 50%). Compaction fires automatically at the pre-step hook and turn-stopping event when usage crosses the threshold, then the summary is injected and the session resumes. Thresholds persist under the dsh-auto-compact namespace in settings.yaml. Note: uninstall the legacy auto-compact package first to avoid double mounting.
dsh-auto-compact 是 DeepSeek Harness 的会话级自动上下文压缩插件。它在输入区右侧显示阈值圆环并实时显示上下文用量,每会话可独立设置 1%–90% 的压缩阈值(默认 50%),超阈值时在回合每步前与回合结束时自动触发 compact,摘要注入后继续;阈值持久化于 settings.yaml,自动模式可在 pre-step 与 turn-stopping 钩子中零侵入生效。注意:旧版包名 auto-compact 须先卸载再装新包,否则会双挂载。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:auto-compact(JohnathonYe/auto-compact)
仓库:https://github.com/JohnathonYe/auto-compact
本站详情页:https://www.yhbd.top/plugins/johnathonye-auto-compact/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 2 · 最近提交 2026-09-29 · 主语言 JavaScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
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:JohnathonYe/auto-compact
把 JohnathonYe/auto-compact 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-auto-compact
中文 · English
会话级自动上下文压缩插件(DeepSeek Harness / DSH)

在输入区右侧显示一个阈值圆环:当前会话上下文用量实时显示,拖动滑杆设置该会话的压缩阈值(1%–90%,默认 50%)。每当用量超过阈值,插件自动触发上下文压缩(compact)——回合中每走一步之前检查一次,回合结束时再检查一次——压缩摘要注入上下文后会话自然继续,全程无需手动干预,也不发送任何「继续」消息。
特性
- 🔴 会话级阈值:每个会话独立设置,互不影响(按
sessionId持久化) - 📊 实时用量:与自带 ContextMeter 同源(
useProjection("contextPressure")),面板打开即实时刷新,无需轮询 - 🎚️ 1%–90% 细腻调节:步进 1%,适合精细控制(未设置时默认 50%)
- 🤖 全自动:回合中每步前 + 回合结束自动检测 → 超阈值自动 compact → 摘要注入后自然继续
- 🛡️ 零崩溃风险:所有检查都在
agent/pre-step(waterfall 中间件)与agent/turn-stopping(串行事件)里做,全程 try/catch,绝不抛出 - 💾 持久化:阈值存于插件自己的 JSON 文件(
$DSH_HOME/dsh-auto-compact.json,默认~/.dsh/dsh-auto-compact.json),重启不丢 - 🧊 与内置安全网并存:DSH 自带的
compaction-basic(默认 80% 压力阈值)保留为兜底,互不干扰
安装
前置:已装好 DSH(dsh web 能正常运行),Node.js ≥ 20、pnpm ≥ 10。
从旧版 auto-compact 升级:旧包名是
auto-compact,新包名是dsh-auto-compact。请先卸载旧包再装新版,避免双挂载(两个 Host 半、两个圆环):npx -y --package @deepseek-ai/dsh dsh plugin --profile web remove auto-compact
一键安装(推荐,复制粘贴即可)
macOS / Linux(Windows 装 Git Bash 或 WSL 也可):
curl -fsSL https://raw.githubusercontent.com/JohnathonYe/auto-compact/main/scripts/install.sh | bash
脚本自动完成全部步骤:安装 npm 依赖 → 注册官方挂载(dsh.profile.bundles)→ 清理旧版残留的挂载行。你只需要:
- 跑上面这一条命令
- 重启 DSH(装完后脚本会提示命令;也可以加上
--restart让它自动重启:curl ... | bash -s --restart) - 强刷浏览器(macOS
Cmd+Shift+R/ Windows·LinuxCtrl+Shift+R),输入区右侧出现阈值圆环 ✅
脚本内部已自动处理:
dsh命令通常不在全局 PATH(DSH 一般经 npx 安装,直接敲dsh会报 command not found),脚本会自动改用 npx 调用,无需用户手动处理。
或者用
npx -y --package @deepseek-ai/dsh dsh plugin --profile web add dsh-auto-compact
装完同样需要重启 DSH + 强刷浏览器。
从本地 checkout 安装(npm 未发布时)
dsh-auto-compact 目前尚未发布到 npm,上面的 dsh plugin --profile web add dsh-auto-compact 需要可用的 npm 源。若你只想跑本地代码,直接把 checkout 链接进 profile:
git clone https://github.com/JohnathonYe/auto-compact.git
cd auto-compact
npx -y --package @deepseek-ai/dsh dsh plugin --profile web add "$PWD"
pnpm 会以 link: 方式把 profile 指向这份 checkout(改完代码重启 DSH 即生效,无需重装);包内声明的 dsh.bundle.patch 仍会被 CLI 协调进 dsh.profile.bundles。
更新 / 卸载
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
liangmianya/dsh-synapse
alaliqing/claude-paper
acryldev/acryl
omdsh-dev/dsh-annotation
Anionex/dsh-turn-rewind
Tyan66666/billion-context-dsh
qkycir-123/dsh-run2skill