nvnoa57-star/dsh-compaction-slider

Project Overview项目介绍

dsh-compaction-slider is a purpose-built plugin for DeepSeek Harness (DSH) that adds a user-friendly UI control for adjusting per-session context compaction thresholds. It adds a small “Compression XX%” indicator chip next to the existing context usage meter ring on DSH’s web input bar, located just to the left of the send button. Clicking this chip opens a popup with a sliding control that lets users set a threshold between 0.4 and 1.0, and the plugin also supports setting the value via the /threshold chat command. The default value of the threshold is 0.8, matching DSH’s official default behavior.

After installation, any new DSH session will load the plugin automatically, and old sessions created before installation will not use the new preset required by this plugin. To adjust the threshold, users just click the chip, drag the slider to their desired value, and release to save the setting. Changes take effect at the next step boundary for the active session, so users do not need to restart DSH or refresh the page to see the change take effect. This plugin is designed for DSH users who want granular control over when context compression triggers across different sessions.

The plugin requires Node.js 22.19 LTS or newer, and DSH version 0.1.1-rc.2, and it is recommended for Windows systems with PowerShell 5.1 or newer. Users must have launched dsh web at least once before installation to complete DSH initialization. Users can install it automatically via a provided PowerShell script that handles all setup steps including backup of existing configuration, and users on other platforms can install it manually by following the step-by-step guide in the README. The plugin is provided under the MIT license, and it does not modify any core DSH node_modules files, making it easy to remove or update later.

这是一款专为 DeepSeek Harness (DSH) 开发的原生插件,用于在当前会话中实时调整上下文自动压缩的触发阈值。它在 DSH 网页端输入栏的上下文占用圆环旁新增了一个「压缩 XX%」标签,点击即可弹出范围为 0.4~1.0 的滑动条,拖动即可设置阈值,同时也支持在聊天中输入 /threshold 命令完成同等设置。插件默认阈值为 80%,符合 DSH 官方默认配置水平。

它的核心特性是按会话独立存储阈值,每个会话可以设置不同的压缩触发比例,切换会话、重启 DSH 都会保留当前设置。调整后阈值会在下一个步骤边界立即生效,不需要修改全局配置也不需要重启 DSH 服务,整体运行稳定对原有功能无影响。插件不修改任何 node_modules 内部文件,属于零侵入扩展,复用了 DSH 官方压缩逻辑的完整链路。

本插件支持一键安装卸载,提供 PowerShell 脚本自动完成安装、注册和预设设置流程,安装前会自动备份原有配置,支持幂等重复执行,脚本还支持一键卸载,操作非常简单方便。依赖要求 Node.js ≥ 22.19 LTS,对应 DSH 版本为 0.1.1-rc.2,推荐 Windows 系统使用,其他平台也可手动完成安装。使用前需要至少启动过一次 dsh web 完成初始化,安装完成后需要重启 dsh web 才能生效。

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:nvnoa57-star/dsh-compaction-slider

把 nvnoa57-star/dsh-compaction-slider 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-compaction-slider

DSH(DeepSeek Harness)上下文压缩阈值滑块插件 —— 在 web 输入栏的上下文使用量圆环旁提供实时滑块,拖动即可调整当前会话的自动压缩触发比例(thresholdRatio,范围 0.4 ~ 1.0,默认 80%)。

  • 按会话独立:每个会话有自己独立的阈值,切换会话、重启 dsh 均保留
  • 即时生效:调整后下一个 step 边界生效,无需改配置、无需重启
  • 零侵入:不修改任何 node_modules 内部文件

功能特性

  • 实时滑块:消息输入栏 ContextMeter 圆环(发送键左侧)旁新增「压缩 XX%」chip,点击弹出 0.4~1.0 滑动条
  • 按会话持久化:阈值随会话日志保存,切换会话/重启都不丢;每个会话默认 80%,互不影响
  • 也支持命令行:聊天里直接输入 /threshold 0.65 等效设置
  • 完整压缩链路:复用官方 compaction-basic 的总结/保留尾部/工具结果裁剪/溢出恢复逻辑,只替换触发比例来源
  • 上下文占用同步显示:弹窗内同时展示当前 ~已用 / 容量
  • 一键安装/卸载:install.ps1 自动完成全部接线,带备份与幂等保护

前置要求

项目 要求
Node.js ≥ 22.19(LTS)
dsh @deepseek-ai/dsh 0.1.1-rc.2(同版本安装:npm install -g @deepseek-ai/dsh)
系统 Windows PowerShell 5.1+(其他平台可手动安装,见下文)
已运行过 至少启动过一次 dsh web(自动初始化 profile)

快速开始(推荐)

git clone https://github.com/nvnoa57-star/dsh-compaction-slider.git
cd dsh-compaction-slider
./install.ps1

脚本自动完成:安装插件包 → 注册 profile 插件行 → 安装 auto-compact 预设 → 设为默认预设。每次修改前自动备份到 $DSH_HOME/install-backups/<时间戳>/。

安装完成后重启 dsh web,新开会话即可看到滑块。

若提示执行策略限制,先执行:

Set-ExecutionPolicy -Scope CurrentUser RemoteSigned

常用参数:

./install.ps1               # 安装(幂等,可重复执行)
./install.ps1 -Force        # 预设已存在时覆盖
./install.ps1 -NoDefault    # 不修改默认预设(需自己在 UI 选择 auto-compact)
./install.ps1 -Uninstall    # 卸载(-Force 同时删除预设)

手动安装(不用脚本时)

  1. 安装插件包:把 dsh-compaction-ui、dsh-compaction-live 两个目录放入 $DSH_HOME\profiles\node_modules\@my-scope\(可拷贝或建 junction)
  2. 注册插件行:在 $DSH_HOME\profiles\web\cordis.patch.yml 追加:
    - insert:
        - id: compaction-settings
          name: '@my-scope/dsh-compaction-ui'
    
  3. 安装预设:把 presets\auto-compact 复制到 $DSH_HOME\.agent-presets\auto-compact
  4. 设为默认:在 $DSH_HOME\settings.yaml 添加:
    agent-presets:
      default: auto-compact
    
  5. 重启 dsh web

无需修改任何 node_modules 内部文件。

使用说明

滑块在哪

打开 web 页面进入任意会话,消息输入栏 发送按钮左侧、ContextMeter 圆环(上下文占用环形指示器)旁边,有一个「压缩 XX%」的小 chip:

  • 点击 chip → 弹出面板
  • 面板内含 0.4 ~ 1.0 的滑动条(步长 0.05)、当前触发比例、上下文占用 ~已用/容量
  • 拖动松手即保存(拖动中有 250ms 防抖,保存时显示「保存中…」;失败会显示红色错误)

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

← 上一个 Prev knowlp-rag 下一个 Next dsh-trellis →