Adds a "Delete" item to the sidebar session menu with a confirmation dialog, then hard-deletes the session.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:txlznbzsdj-collab/dsh-session-delete
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.
在 DSH Web 侧边栏「会话列表」中,给每个会话的三点下拉菜单底部新增一个 「删除」 按钮,点击后弹出二次确认对话框,确认后硬删除该会话(内存会话 + 磁盘持久化数据一并移除)。
功能
- 会话三点菜单底部新增「删除」项(危险样式,红色)。
- 点击「删除」→ 弹窗确认「此操作会永久删除该会话,无法恢复」。
- 确认后调用 host 端点硬删除:
- dispose 内存中的 live 会话(触发
session/disposed→host/session-removed,所有客户端列表即时移除); - 删除磁盘上的持久化 jsonl 会话目录,确保重启后不再出现。
- dispose 内存中的 live 会话(触发
- 删除成功/失败有轻量 toast 提示。
安装(注册到 web profile)
- 把本目录放到任意插件目录,例如:
E:\桌面\dshGUI_install\plugins\dsh-session-delete - 编辑
C:\Users\<用户>\.dsh\profiles\web\package.json:- 在
dependencies增加:"dsh-session-delete": "link:E:/桌面/dshGUI_install/plugins/dsh-session-delete" - 在
dsh.profile.bundles数组加入:"dsh-session-delete"
- 在
- 在
C:\Users\<用户>\.dsh\profiles\web下执行:pnpm install - 重启 DSH Web GUI(
dsh web),刷新浏览器。
说明与限制
- 客户端用 DOM 注入:监听
[role="menu"]会话菜单出现,克隆现有菜单项样式并追加「删除」。菜单类名是哈希的,因此采用“克隆现有项”而非硬编码类名,具备一定的版本韧性。 - 会话 id 通过 React fiber(
__reactFiber$…链上的memoizedProps.node.id)读取,不依赖 DOM data 属性。 - host 端点
/plugins/dsh-session-delete/delete仅允许本机回环地址访问,并校验 Origin,防止跨站调用。 - 依赖 DSH 内部会话存储(
ctx.sessions.store)与持久化服务(ctx.sessionPersistence)。若 DSH 后续升级改变这些内部结构,可能需要相应适配。 - 「删除」是硬删除,不可恢复,请谨慎使用。
开发 / 验证
本地改完 client.js 后无需重启 GUI(host 端 index.js 不变时),浏览器硬刷新(Ctrl+Shift+R)即加载新版。
端到端验证用 verify/ 下的 CDP 脚本:
# 用 --remote-debugging-port=9222 启动 Chrome 并打开 GUI,然后:
npm run verify
提交到 awesome-dsh-plugin
本插件符合 awesome-dsh-plugin 收录要求:仓库 package.json 声明了 dsh.bundle manifest,cordis.patch.yml 提供了 loader 注入项,且为真实可用代码。
Links
More in this category
Minglink/dsh-infinite-gen-4★ 2250
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.
ranxianglei/billion-context★ 472
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).
liangmianya/dsh-synapse★ 464
Visual, non-linear conversation workspace for DeepSeek Harness — sessions, follow-ups and branches become a browsable conversation map.
Nwflower/dsh-chat-import★ 208
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.
Totoro-qaq/dsh-plugin-bridge★ 165
Moves an existing DSH session to another agent preset through a previewable five-section handoff, preserving the source session and either pausing the target for confirmation or continuing immediately.
Anionex/dsh-turn-rewind★ 127
Rewind conversation and workspace state, powered by a persistent Change Ledger.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.