Skip to content

dsh-history-cleanup-plugin

Verified

dsh-history-cleanup-plugin · v0.1.1 · MIT

DeepSeek Harness 会话清理插件:注册 history_cleanup 工具,盘点 / 归档 / 永久删除历史会话,并清掉悬空的归档 id。

Install

dsh plugin add dsh-history-cleanup-plugin

Confirm the layer applied with dsh --profile default --dump-config — see the install guide.

Source

Published to npm without a public repository. Inspect the package contents before installing.

Tags

Readme

dsh-history-cleanup-plugin

DeepSeek Harness 会话清理插件。它把一个 Host 工具挂进 Profile:

工具 作用
history_cleanup list 盘点 · archive 归档 · purge 永久删除(顺带清理残留归档记录)

安装

Web 侧边栏 Plugins → Add plugin,填这个目录的绝对路径;或用 plugin_manager 的 install_bundle。装好后行 id 是 history-cleanup。

三个动作

选择范围只有两种:点名 ids,或者不给 ids(= 全部非活跃会话)。没有按时间筛选的参数。

  • list — 只读。枚举 $DSH_HOME/sessions 下每个会话的日志目录,报出会话数、磁盘占用、 已归档数、活动会话数,并列出最近 15 个会话(附带它记录的 cwd)。
  • archive — 走 workspaceRegistry.archiveSession() 公开 API,只把会话从侧边栏藏起来, 不碰任何文件。
  • purge — 从磁盘删掉会话日志目录与它的投影缓存文件,不可撤销。必须显式传 confirm: true;当前会话和所有活动会话永远拒绝。删完会顺手清掉这批会话在归档集合里 留下的悬空 id——日志都没了,留着那条归档记录没有意义。

依赖与边界

  • 只需要运行中的 Profile 提供 tools、shell、workspaceRegistry、sessions 四个服务;不需要 MCP 服务器,也不需要任何 config 键。
  • purge 的删除步骤会为自己的 shell 调用申请 danger-full-access:会话日志在会话 工作区之外,不申请就删不掉。这是工具内部的单次申请,不改变 Profile 或会话的沙箱策略。
  • 该插件的代码在 Host 进程内运行。装它等于允许 Agent 在拿到 history_cleanup 且用户 确认 confirm: true 时永久删除历史会话;只在你接受这一点的 Profile 里挂载。