npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-conversation-delete

v1.0.0

Published

Delete a DSH conversation (Session) and all of its local data, from the sidebar menu or through a session_delete tool.

Readme

Conversation Delete · 删除对话

license dsh node

给 DeepSeek Harness(dsh) 加一个"删除对话"的功能: 在左侧会话列表每一行的 ... 菜单里多一项 删除对话,确认后把这个对话在本地的一切删掉; 同时给 agent 一个 session_delete 工具,你也可以直接对它说"把某个对话删了"。

会话行的「...」菜单,最下面是红色的「删除对话」

它到底做什么

  • 一个菜单项:鼠标移到左边任意一个对话那一行 → 点行尾的 ... → 菜单最下面多出红色的「删除对话」(在"归档会话"下面)。
  • 一次确认:点它之后弹出确认框,写明要删哪个对话;点「删除」才真的删,点「取消」/Esc/点框外都不动。
  • 一起清干净:删掉这个对话的聊天记录文件、它的缓存记录、以及它在工作区列表里的登记——不是只从界面上藏起来。

删掉的三个位置(默认路径):

| 数据 | 位置 | |---|---| | 会话日志 | <DSH_HOME>/sessions/<项目>/<会话 id>/session.v4.jsonl.zstd | | 投影缓存 | <DSH_HOME>/storages/session_projcache/sessions/<会话 id>.json | | 工作区归属 | workspace.json 里该工作区的 sessionIds,以及归档/置顶集合 |

<DSH_HOME> 默认是 ~/.dsh(Windows:C:\Users\<你>\.dsh)。

怎么用

  1. 鼠标移到左侧对话列表里你想删的那一行上。
  2. 行尾出现 ...(三个点),点开。
  3. 点最下面红色的 删除对话。
  4. 弹出确认框 → 点 删除。这一行立刻消失。

什么情况下它会拦你

| 情况 | 提示 | |---|---| | 那个对话正在干活(AI 正在回答、还有后台任务/子任务/定时任务没跑完) | "还有活儿在跑,先停掉" | | 那个对话正是你现在打开着的 | "请先切换到其它对话再删除" | | 你想删当前正在聊天的这个对话(工具路径) | "正在运行的对话不能删自己" |

这些拦截不是毛病:删掉一个还在被写的对话,会把它写坏。

安装

前提:目标机器上装了 dsh,并且有 pnpm(pnpm -v 能跑;dsh 的插件安装器要用它)。

在 dsh 的 Plugins 页面 点 「添加插件」,把下面任意一种粘进「包名或地址」输入框,点「安装」:

| 从哪装 | 输入框里填 | |---|---| | npm(推荐) | dsh-conversation-delete | | 本机 .tgz 文件 | D:\下载\dsh-conversation-delete-1.0.0.tgz(换成你自己的绝对路径) | | 本机源码目录 | D:\github\dsh-conversation-delete | | GitHub 仓库 | https://github.com/YZB-author/dsh-conversation-delete |

也可以让你的 dsh agent 装:直接对它说"安装 dsh-conversation-delete"或"安装 D:\...\xxx.tgz"。

装好后:Plugins 列表里出现 Conversation Delete,会话菜单里出现 删除对话,agent 多一个 session_delete 工具。

  • 填目录是"链接",改这个目录里的代码、重启 dsh 即生效(适合开发)。
  • 填 .tgz 或 npm 名是一份冻结副本(适合发给别人)。
  • **替换已装过的同名插件(升级)**时,dsh 会提示 restart-required:重启一次 dsh 生效。全新安装会当场生效。

卸载

Plugins 页面里把 Conversation Delete 移除(或 plugin_manager 工具的 remove_bundle,目标 dsh-conversation-delete)。 菜单项随即消失。已经删掉的对话不会回来(那是永久删除)。

注意

  • 永久删除,不进回收站,删完找不回来——所以有确认框。
  • 不删附件:你聊天里发过的图片/文件原文件(<DSH_HOME>/attachments)是共享的、没有引用计数,删对话时连带删风险更大,所以留着。
  • 删除后,那个对话在本进程里的内存实例要等 dsh 退出才释放;磁盘上的日志/缓存/归属是立即删掉的。
  • 删除会留下一条"墓碑"记录(保证常驻的 Agent 不会把刚删的日志写回来),它会在下次 dsh 启动时自动清掉。

自己验证

不需要装 dsh,也不需要联网:

node test/verify.mjs      # 或 npm test

26 项断言:加载真正的 host.js,用假的服务 + 一个临时 DSH_HOME 跑一遍完整删除、墓碑清理和各种拒绝路径,不碰任何真实的 dsh 数据。

原理(好奇的话再看)

  • 删除前先给这个会话做一次 归档(archive):① 若它还有正在跑的东西就直接拒绝;② 留下一条持久"墓碑",它的门会拦掉之后所有写入,保证删掉的对话不会被"复活"成半个日志。
  • 墓碑只在还有常驻实例可能写它时才有意义,所以插件在启动时和每次删除后会扫一遍,把既无常驻实例、又无日志的墓碑清掉。正常的"已归档"对话因为有日志,永远不会被误清。
  • 会话 id 先按白名单校验(防路径穿越);如果会话在持久化里有记录、却在 <DSH_HOME>/sessions 下找不到日志目录(比如部署把 persistence root 改到了别处),在改任何状态之前就拒绝,绝不"删了一半"。
  • 零运行时依赖:Host 半只用 node 内置模块,Client 半只从页面模块表拿 React,样式只用 --dsw-alias-* 主题令牌,外观与官方菜单行一致。

兼容性

  • 已在 dsh 0.2.0-rc.2 + cordis 4.0.4(Windows) 上验证。
  • peerDependencies 会让 dsh 的安装器在版本不匹配时直接拒绝安装,而不是装上去再崩(pnpm 日志里会出现 "missing peer" 提示,属正常,因为 dsh 的包不在 profile 的 node_modules 里)。
  • 依赖的宿主能力:/api 上的 exact Fetch route、工作区注册表(archiveSession / detachSession / unarchiveSession)、api-session/removed 事件、以及 session-persistence-jsonl 的磁盘布局。
  • Linux/macOS 上写租约是 POSIX flock(Windows 上是命名内核锁),都不会占住日志文件,所以删除在三个平台都可行;但只有 Windows 做过实测。

文件

| 文件 | 作用 | |---|---| | host.js | Host 半:删除操作 + /api/conversation-delete 路由 + session_delete 工具 + 墓碑清理 | | client.js | Client 半:会话行菜单项(带垃圾桶图标)+ 确认框 + "当前打开的对话"守卫 | | cordis.patch.yml | bundle 的 loader 补丁:插入一行 Host 插件 | | package.json | dsh.bundle.patch / dsh.client 声明、files、peerDependencies | | locale/{en,zh}.json | Plugins 页面显示用的标题与描述 | | screenshots/menu.png | README 配图 | | icon.svg | Plugins 卡片图标 | | test/verify.mjs | 离线自测(26 项) |

License

MIT


English quick start

Adds a Delete conversation entry to every conversation's sidebar ... menu (with a trash icon), plus a session_delete tool for the agent, and removes the Session log, its projection-cache record and its workspace accounting.

Install it in dsh's Plugins page (or via the plugin_manager tool's install_bundle) with any of: dsh-conversation-delete (npm), an absolute path to a .tgz, a local checkout directory, or a git URL. Requires pnpm on the machine. Uninstall by removing the dsh-conversation-delete bundle.

Verify locally without a dsh install: node test/verify.mjs (26 offline assertions).

Verified against dsh 0.2.0-rc.2 on Windows; peerDependencies make the installer refuse incompatible runtime versions. Deletion archives the Session first as a durable tombstone (so a resident Agent cannot rewrite the log) and refuses Sessions with running work or a currently open conversation. Attachments are left alone on purpose.