Bundle
dsh-session-sight
DeepSeek Harness 会话「看清再动手」外挂:归档/彻底删除(走系统回收站)+ 会话内容只读预览(Markdown),零依赖、不 patch 官方。
- Source
- Yidien
- License
- MIT
- Updated
- Updated 2 days ago
Readme
# dsh-session-sight DeepSeek Harness(DSH)会话「看清再动手」外挂插件。 侧栏底部两个入口,删/归档会话**前先看清内容**,删得干净、归档不毁数据。 - **零依赖**:host 端不 import 任何 `@deepseek-ai/*` 包,只用 Node 内置 + 官方公开 service; - **不 patch 官方**:外挂式挂载,dsh 升级不受影响; - **看清再动手**:活跃/归档会话都能只读预览内容(Markdown 渲染); - **删除走系统回收站**:彻底删除进 Windows 回收站,还能捞回来; - **归档不毁数据**:走官方 `archiveSession`,日志与位置保留,可随时取消归档。 ## 功能 侧栏底部两个入口: | 入口 | 列表 | 每行动作 | |---|---|---| | 🗑 删除会话 | 活跃会话(含「当前」标记) | 预览 / 归档 / 彻底删除 | | 📦 归档列表 | 已归档会话 | 预览 / 取消归档 / 彻底删除 | 预览面板只读展示最近 20 条「你 / 助手」消息,支持 GFM Markdown(标题、列表、表格、代码块、引用等)。 ## 命令 插件提供 9 个斜杠命令。UI 只走「归档 + 彻底删除」这条主线;临时回收站命令已由归档替代,仅保留供命令行使用。 ### 当前核心命令 | 命令 | 作用 | |---|---| | `/archive-session <id\|标题>` | 归档(隐藏、不毁数据,可取消归档还原) | | `/archived` | 列出归档会话 | | `/unarchive <id\|标题>` | 取消归档,回原位置 | | `/recycle-session <id\|标题>` | 彻底删除(进系统回收站,可捞回) | ### 临时回收站旧命令(已由归档替代,仅命令行备用) | 命令 | 作用 | |---|---| | `/delete-session <id\|标题>` | 移入临时回收站(可恢复) | | `/restore-session <id\|标题>` | 从临时回收站恢复 | | `/trash` | 查看临时回收站 | | `/empty-trash confirm` | 清空临时回收站(自动扫残留) | | `/clean-orphans` | 清理 projcache 残留孤儿 | ## 设计要点 - **归档 ≠ 删除**:归档用官方 `archiveSession`(只加隐藏标记),日志和 `sessionIds` 席位都不动; - **彻底删除**:目录移入系统回收站,同时清 `projcache` + `workspace` 账目 + 归档集合; - **预览**:日志是「拼接 zstd 帧 + JSONL」,用 Node 内置 `zlib.zstdDecompressSync` 逐帧解压(零依赖),只读、只取最近 20 条; - **方案 B 索引重建**:删除后调 `workspaceRegistry.replaceHeaderIndex` + `indexLiveSessions`,清掉已删 id 的「撞车残留」,免重启。 ## 安装 ### 从 npm(推荐) ```bash dsh plugin --profile web add dsh-session-sight ``` ### 本地挂载 1. 把本目录软链/复制到 profile 的 `node_modules/dsh-session-sight`; 2. 在 `~/.dsh/profiles/web/package.json` 的 `dsh.profile.bundles` 加 `"dsh-session-sight"`; 3. 重启 dsh + 浏览器强刷新。 ## 兼容性 - 需要 Node 22+(`zlib.zstdDecompressSync` 从 Node 22 起可用,Node 24 已验证); - 仅 Web 端有 UI(`platform: web`);命令在所有端可用。 ## 参考与致谢 本项目以下实现借鉴(并本地演化)自社区项目与官方源码: - [lsz-asd/dsh-plugin-session-delete](https://github.com/lsz-asd/dsh-plugin-session-delete):清脏思路与函数雏形(`sessionIdVariants` 双 id 拼写、`stripStorageDomains` 走 storageDomain 清 projcache 行 + workspace 账目); - [wsxwj123/dsh-plugins · dsh-session-manager](https://github.com/wsxwj123/dsh-plugins/tree/main/packages/dsh-session-manager):幽灵行判定、恢复不被覆盖目录、`/empty-trash confirm` 二次确认等语义; - [Ultronen/dsh-archived-chats](https://github.com/Ultronen/dsh-archived-chats):host 端懒绑定 HTTP 查询面(`/plugins/.../state` 路由)的挂载姿势; - [deepseek-ai/deepseek-harness](https://github.com/deepseek-ai/deepseek-harness) 官方源码与文档:client bundle 契约、`sidebar.footer.action` slot、`MarkdownText`、`archiveSession` 等官方公开接口用法。 其余逻辑(两级删除语义、系统回收站清理、zstd 多帧预览解码、客户端薄壳面板)为本项目自行实现。 ## License MIT
Install
dsh plugin --profile web add github:Yidien/dsh-session-sight
Profile: web
With the hub plugin installed, ask your agent to install it by name — it resolves the same plan shown here.
dsh plugin --profile web add github:stvlynn/dsh.fish#path:packages/dsh-plugin-hub
install dsh-session-sight from the hub
- This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.