Adds a confirmed permanent-delete action to ordinary, archived, pinned and idle-open DSH sessions, with authenticated Host routing, identity and activity rechecks, journal recovery, and Windows/WSL association cleanup that preserves project files.
Install
# from a prebuilt release tarball
dsh plugin --profile web add -w "https://github.com/makaiqi8/dsh-session-purge/releases/download/v0.1.0/dsh-session-purge-0.1.0.tgz"
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:makaiqi8/dsh-session-purge
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
This plugin publishes its README in Chinese only.
为 DeepSeek Harness(DSH)补上真正的“彻底删除会话”:红色垃圾桶菜单项位于“归档会话”下方,人工确认后清理会话日志、投影缓存、可安全归属的 spill 和工作区/归档/置顶关联。
特性
- 使用 DSH 原生
contextMenus、icon 与shell.overlay扩展点。 - 使用官方
connection.fetch受鉴权路由,不开放无鉴权 WebServer 端点。 - 支持普通、归档、置顶和当前打开但空闲的会话。
- Windows 与 WSL 工作区共用真实 Session 存储定位。
- 不修改 DSH 源码、app.asar、内置 prompt、dsh-purge 或其他插件。
- 没有 Agent 删除工具、遥测、远程更新或第三方运行时依赖。
- 删除前重新检查活动、身份、revision、后端和真实路径;失败可恢复,不假报成功。
兼容性
- DSH:
>=0.2.2-rc.5 <0.3.0 - Node.js:
>=24.9 - 存储:当前 JSONL 后端;未知或其他后端 fail closed。
- dsh-purge:原版与 clean 模式使用同一插件,无模式专用补丁。
- dsh-wsl-workspace:WSL UNC cwd 仅作为会话元数据,插件不进入 WSL 删除项目文件。
安装
DSH 原生插件管理器(推荐)
在 DSH 的“插件”页选择“添加插件”并添加本仓库目录的绝对路径。若使用 DSH 内的插件开发工作流,也可调用:
plugin_manager → install_bundle → target: <本仓库的绝对目录>
管理器返回 applied 表示 Host 已激活;返回 restart-required 时,完全退出并重开 DSH。不要把“文件已保存”当作“插件已运行”。
官方 CLI 备选
dsh plugin --profile desktop add <本仓库的绝对目录>
也可以安装预构建 tarball,无需构建脚本:
dsh plugin --profile desktop add ./dsh-session-purge-0.1.0.tgz
安装后重启 DSH,打开任意会话的“⋯”菜单验证。
使用与删除边界
- 点击“归档会话”下方的红色“彻底删除”。
- 在确认框中核对 Session ID、工作目录、日志目录数量和关联子代理数量。
- 点击“彻底删除”。操作不可撤销,不进入回收站。
会删除:
- 目标 JSONL 会话目录;
- 该 Session 的投影缓存;
- 能由 Session ID 精确归属的 spill 子目录;
- 工作区成员、归档和置顶关联;
- 确认框中明确计数的隐藏子代理会话。
不会删除:
- 实际项目目录和项目文件;
- 工作区注册本身;
- 共享附件、凭据、费用账本、其他插件数据库;
- dsh-wsl-workspace 的用户名配置;
- 可见 fork。目标存在可见 fork 时,本插件会拒绝删除并保留所有内容。
正在运行、等待审批、仍有后台活动或日程关联的会话会被拒绝。活会话只有在停止、排空、关闭句柄和卸载能力全部可用时才可删除。
失败与恢复
删除采用串行队列和原子 journal。中途失败会保留剩余步骤,确认框提供“重试未完成项”;下次插件激活时也会做一次有身份与路径门禁的恢复。
如果同 ID 已变成另一个生命周期,或残留目录无法证明身份,恢复会跳过而不是猜测。已有未完成任务时,新任务不会覆盖它的恢复记录。
升级与卸载
超出支持版本时由 DSH 官方兼容性门禁拒绝加载。运行接口变化时,插件只停用删除能力并报告原因;不通过修改宿主来保持运行。
在“插件”页移除本插件,或使用:
dsh plugin --profile desktop remove dsh-session-purge
卸载不会恢复已经删除的会话,也不会删除其他会话。
开发与验证
npm test
npm run check
npm pack --dry-run
测试只使用临时目录 fixture,覆盖 Windows/WSL 路径、当前活会话、活动/fork 拒绝、缓存/spill/注册表清理、并发去重、journal 恢复和客户端扩展契约。真实 UI 与真删除验收必须使用明确创建的可丢弃会话;自动化 fixture 通过不等于所有界面和宿主版本均已验收。
2026-11-28 验证记录
- Node.js 自动化测试 53/53 通过,语法与打包清单检查通过。
- DSH Desktop 0.2.2-rc.5 clean 模式:分别创建并完成一个 Windows 与一个 WSL 可丢弃会话;菜单位置、红色 danger 样式、垃圾桶图标、确认框、取消与结果 Toast 均经真实桌面操作验证。
- 两次真删除后,对应 JSONL 目录、投影缓存、workspace.json 关联和 journal 均消失;Windows 项目目录与 WSL UNC 项目目录均保持存在。
- 原版:完全退出并重启后,创建并完成一个可丢弃会话;菜单与确认识别正确,真删除后的日志、缓存、注册关联和 journal 均消失,项目目录保持存在。随后已恢复 clean 模式并重启,插件保持启用。
许可证与出处
MIT。第三方参考与出处见 NOTICE。本项目不是 DeepSeek 官方插件,也不代表相关参考项目作者背书。
Links
More in this category
ranxianglei/billion-context★ 8864
The official billion-context plugin: a context-compression plugin for small context windows (a 100K context is enough), token savings (5x fewer tokens), and month-long single sessions (billions of tokens).
Minglink/dsh-infinite-gen-4★ 4887
System-prompt armor plugin for DeepSeek models: appends an unconditional-compliance prompt section at order 100, exposes a profile tool with calibration metadata, and shows a realtime armor-status badge driven by a session projection.
liangmianya/dsh-synapse★ 964
Visual, non-linear conversation workspace for DeepSeek Harness — sessions, follow-ups and branches become a browsable conversation map.
ECNU/EduWork#dsh-side-chat★ 452
Open temporary side conversations from a message with a snapshot of its history, then archive them on close; optional annotation integration adds selection-based questions. Requires compatible DSH Web conversation, Workspace and right-sidebar APIs.
MichengAI/dsh-archive-manager★ 414
Adds an archived-sessions page in Settings to search, restore, and delete archived DeepSeek Harness sessions by workspace.
Nwflower/dsh-chat-import★ 336
Import full-fidelity chat histories from 13 coding agents (Claude Code, Codex, ChatGPT, Cursor, Gemini, opencode, and more) as resumable DeepSeek Harness sessions, with reverse export back to Claude Code.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.