longhao666666/dsh-session-delete

DeepSeek Harness 插件:侧栏一键删除会话(先归档再清理磁盘日志,运行中的会话受保护)

Project Overview项目介绍

dsh-session-delete is a native Cordis plugin built exclusively for the DeepSeek Harness (DSH) desktop application, designed to permanently erase chat sessions and their on-disk logs from the sidebar. It ships as @local/dsh-session-delete, mounted into ~/.dsh/profiles/desktop/node_modules/@local, and registered via the dsh.profile.bundles field in the profile's package.json so the DSH bundle manifest loader picks it up. The current release is 0.1.0, validated on Windows against DSH 0.2.0-rc.2, with zero runtime dependencies, no tokens, no API keys, and no compilation step required.

The typical workflow begins by restarting DeepSeek Harness so the newly mounted bundle is discovered, then opening the Plugins management page to confirm @local/dsh-session-delete is enabled. Users hover over any session row in the sidebar and click the trash-can icon, or alternatively pick the red "Delete Session…" entry in the row menu; a confirmation dialog warns that the action is irreversible and the disk log directory will be removed as well. The host-side code first invokes the official archive flow, uses the persistence layer's locate() to pinpoint the exact directory, validates its <root>/<project>/<session-id> shape, refuses deletion on live sessions to prevent torn logs, emits api-session/removed, and finally shows a "Deleted session 'xxx'" toast that triggers an immediate list refresh.

Dependencies are minimal: a Windows host with DSH Desktop installed and launched at least once is enough, and pure JavaScript sources are loaded directly. Installation is handled by either a one-shot install.ps1 PowerShell script (which auto-detects DSH, creates the @local link folder, and writes the profile configuration) or a manual Junction-based mount, while uninstallation reuses the same script with the -Uninstall flag, leaving the cloned repository files intact. The plugin targets power users who genuinely need to reclaim disk space rather than merely hide conversations; anyone preferring soft removal should stick with the built-in archive action. It is released under the MIT license, and the deletion it performs is permanent and cannot be undone through DSH's own recovery tools.

dsh-session-delete 是一个面向 DeepSeek Harness(DSH)桌面版的原生 Cordis 插件,专门用于在侧栏一键永久删除会话记录(含磁盘日志)。它以 @local/dsh-session-delete 的形式挂载到 ~/.dsh/profiles/desktop/node_modules/@local,并在 profile 的 package.json 中通过 dsh.profile.bundles 字段注册,由 DSH 的 bundle manifest 机制加载。当前版本 0.1.0,开发时基于 Windows + DSH 0.2.0-rc.2 验证,零依赖、无需 Token 或 API Key。

典型使用流程是:先重启 DeepSeek Harness,进入「插件管理」确认插件已启用;然后在侧栏会话行悬停点击垃圾桶图标,或在会话行菜单中选择红色「删除会话…」。插件会先调用官方归档流程,再通过持久化层的 locate() 定位日志目录,校验目录形状后执行物理删除,运行中的会话会被拒绝以防日志撕裂,完成后弹出「已删除会话「xxx」」toast 并触发 api-session/removed 事件刷新列表。该插件适合需要清理占盘会话或整理历史记录的重度用户。

依赖方面仅要求 Windows 与已至少启动过一次的 DSH 桌面版,常规 JS 源码直接加载,无需编译。提供 install.ps1 一键脚本与手动 Junction 软链两种安装方式,卸载通过同脚本的 -Uninstall 参数完成,但克隆下来的仓库文件不会被删除。删除操作不可恢复,若只想隐藏会话应继续使用官方归档功能;插件以 MIT 协议开源。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • 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:longhao666666/dsh-session-delete

把 longhao666666/dsh-session-delete 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-session-delete

侧栏一键删除会话——先归档,再永久清理磁盘日志

version license platform dsh stars

简体中文 | English


零依赖:常规 Cordis 插件,纯 JS 源码直接加载——无需编译、无需 Token / API Key、无需额外服务。

删除的是会话的完整记录(含磁盘日志),且不可恢复——不想这么彻底的话,请继续用官方的「归档」。

功能特性

能力 说明
两个入口 会话行悬停时的垃圾桶按钮;会话行菜单里的红色「删除会话…」项(排在「归档」之后)
确认弹窗 明确提示「将永久删除「xxx」的完整对话记录(含磁盘日志),此操作不可恢复」,防止误触
安全围栏 先走官方归档流程;运行中的会话(live session)直接拒绝删除,防止撕裂日志产生残影;删除前校验目录形状(<root>/<project>/<session-id> 两级),只删目标会话自己的目录
精确定位 使用持久化层提供的 locate() 位置,绝不自行拼接路径
即时反馈 删除成功后 toast 提示「已删除会话「xxx」」,会话列表立即刷新

环境要求

  • Windows
  • DeepSeek Harness 桌面版已安装,并至少启动过一次(开发时基于 0.2.0-rc.2 验证)

安装

一键脚本(自动检测 DSH、建立 node_modules/@local 链接、写入 profile 配置):

git clone https://github.com/longhao666666/dsh-session-delete.git
cd dsh-session-delete
powershell -ExecutionPolicy Bypass -File .\install.ps1
方式二:手动挂载(点开查看)
$profile = "$env:USERPROFILE\.dsh\profiles\desktop"
$repo    = "<你的克隆路径>"    # 例如 "$HOME\code\dsh-session-delete"

New-Item -ItemType Directory -Force "$profile\node_modules\@local" | Out-Null
New-Item -ItemType Junction -Path "$profile\node_modules\@local\dsh-session-delete" -Target $repo

然后编辑 $profile\package.json,合并以下字段(已存在的字段里追加即可):

{
  "dependencies": {
    "@local/dsh-session-delete": "link:C:/Users/you/code/dsh-session-delete"
  },
  "dsh": {
    "profile": {
      "bundles": ["@local/dsh-session-delete"]
    }
  }
}

两种方式完成后都需重启 DeepSeek Harness,并在「插件管理」页确认 @local/dsh-session-delete 已启用。

使用说明

  1. 重启 DSH 后,把鼠标悬停在侧栏任意会话行上,点击垃圾桶图标;或打开会话行菜单,选择「删除会话…」。
  2. 在确认弹窗中点击「删除」。
  3. 看到「已删除会话「xxx」」toast 即完成,磁盘上的日志目录同时被清理。

卸载

powershell -ExecutionPolicy Bypass -File .\install.ps1 -Uninstall

重启 DSH 后生效;克隆下来的仓库文件不会被删除。

工作原理(点开查看)
  • host.js(Node 侧):归档 → 通过持久化层定位日志目录 → 校验目录形状 → 删除 → 从工作区脱离 → 发出 api-session/removed 事件让客户端刷新列表;所有安全围栏都在这一侧。
  • client.js(浏览器侧):向 sidebar.workspaces.session.menu.item(行菜单)、sidebar.workspaces.session.row.action(悬停按钮)、shell.overlay(确认弹窗 + toast)三个扩展槽注入 UI,只负责发起请求与展示。

相关插件

许可证

MIT

← 上一个 Prev dsh-ds-balance 下一个 Next DSH-Transparent-UI-Plugin →