본문으로 건너뛰기
K

dsh-manual-compact

kimkingyu/dsh-manual-compact

Manual context compaction for DeepSeek Harness: keep the latest N conversation items with stop or batch mode and a per-session compaction archive — embedded in the context meter popup when the meter panel slot exists, or a composer button otherwise.

설치

dsh plugin --profile web add github:kimkingyu/dsh-manual-compact

README

dsh-manual-compact-plugin

手动上下文压缩插件(DeepSeek Harness / DSH)。

点击上下文圆圈(或输入框旁的"压缩"按钮)→ 填写保留最近 N 条 → 停止或分批压缩 → 每次压缩都有存档可查。

功能

  • 保留最近 N 条:直接输入保留数量(默认 4,建议 1–4 条)
  • 处理方式
    • 完成一批后停止
    • 分批处理直到完成
  • 取消压缩:压缩过程中可随时取消
  • 压缩进度:分批模式下实时显示进度条(已处理 / 总数)
  • 可读结果文件:每次压缩自动追加到 ~/.dsh/manual-compact/<会话>.md,含时间 / 保留数 / 压缩条数 / 摘要,可用任意文本编辑器打开
  • 压缩存档:每次压缩显示时间、条数、约计 tokens,点击展开完整摘要
  • 调用 DSH 官方 compaction API(compaction.compactRegion):不拆开工具调用对、会话忙时自动拒绝、失败不改动会话

安装

dsh plugin --profile web add dsh-manual-compact-plugin

安装后重启一次 DSH。

界面位置

  • 如果 DSH 带有 conversation.input.contextMeterPanel Slot(对应上游补丁),控件嵌入上下文圆圈弹窗
  • 否则自动降级为输入框工具行右侧的"压缩"按钮(弹窗面板)

工作原理

  • 浏览器端通过 manual-compact 设置命名空间写入 request(会话、保留数、模式)
  • 宿主端读取请求,经当前会话的 compaction 服务执行,把结果写回 lastRun
  • 存档来自会话日志中已落地的 compaction/summary 事件,随会话持久化

License

MIT

관련 플러그인