Bundle
@huangzhaoyu/dsh-trashbin
DSH 回收站(删除冷静区):归档的对话进入回收站,支持恢复、立即移除、7 天自动清理
- Source
- SUJIElearning
- stars
- 1 stars
- License
- MIT
- Updated
- Updated 4 days ago
Readme
# @huangzhaoyu/dsh-trashbin — DSH 回收站(删除冷静区)
> 归档的对话进入回收站,7 天内可反悔恢复;7 天自动清理,绝不物理删除对话内容。


---
## 这是什么?
DSH(DeepSeek Harness)的「归档会话」默认只把对话从侧边栏隐藏,**没有任何地方能看到已归档的对话**,更无法恢复——归档等于"永久消失"。
本插件给归档加了一个**回收站(删除冷静区)**:
- 📥 归档的对话进入回收站(侧边栏左下角设置按钮旁新增按钮)
- ↩️ 7 天内可随时**恢复**,回到原来所在的工作区
- 🗑️ 可手动**移除**,或等待 **7 天自动清理**
- 🔒 所有操作**永不删除会话日志**(`~/.dsh/sessions` 完好保留,只是从界面消失)
## 安装
> **所有安装方式都需要重启 DSH**(UI 插件是"一次性 surface",重启后才会加载)。
### 方式 A:一条命令(推荐,需有 `dsh` 命令)
```sh
dsh plugin --profile web add @huangzhaoyu/dsh-trashbin
# 然后重启 DSH
```
没有全局 `dsh` 命令时,用 node 直接调用:
```powershell
node "你的DSH路径\node_modules\@deepseek-ai\dsh\lib\bin.js" plugin --profile web add @huangzhaoyu/dsh-trashbin
```
### 方式 B:脚本安装(Windows,本地下载)
```powershell
powershell -ExecutionPolicy Bypass -File install.ps1
# 然后重启 DSH
```
脚本会自动:备份 → 复制到 profile → 注册依赖与 bundles → 验证文件完整性。
### 方式 C:手动安装
1. 复制 `dsh-trashbin` 目录到 `~/.dsh/profiles/web/node_modules/@huangzhaoyu/`
2. 在 `~/.dsh/profiles/web/package.json` 的 `dependencies` 加 `"@huangzhaoyu/dsh-trashbin": "^0.1.0"`
3. 在 `dsh.profile.bundles` 数组追加 `"@huangzhaoyu/dsh-trashbin"`
4. 重启 DSH
### 卸载
```powershell
powershell -ExecutionPolicy Bypass -File uninstall.ps1
# 然后重启 DSH
```
或从 bundle 列表和 dependencies 中移除 `@huangzhaoyu/dsh-trashbin`,重启 DSH。
## 功能细节
| 功能 | 说明 |
|------|------|
| 回收站入口 | 侧边栏左下角设置按钮旁 · 垃圾桶图标 |
| 回收站面板 | 显示归档时间 / 剩余天数 / 原工作区 / 标题 |
| 恢复 | 从归档集合移除,会话回到原工作区原位置 |
| 移除 | 从回收站消失(保持归档,界面再也不显示) |
| 7 天清理 | 归档超 7 天未恢复自动移除(剩余 ≤2 天红色警示) |
| 空状态 | "回收站是空的"提示 |
## 安全设计
- **不改 DSH 核心**:独立包,走官方 bundle + client 双面机制挂载
- **不删日志**:`~/.dsh/sessions` 任何文件都不被触碰
- **写链安全**:恢复操作走 storage domain 同一写链,与 DSH 自身写入安全排队
- **幂等**:恢复不存在/未归档的会话不报错
- **可回滚**:install.ps1 备份 package.json,uninstall.ps1 一键还原
## 已知说明
- 回收站状态(归档时间等)存浏览器 `localStorage`;清缓存后会丢失时间信息,表现为归档对话全部立即显示为"过期"(不影响归档本身,不崩溃)
- 7 天过滤在打开回收站时触发;连续 7 天不开则清理顺延到下次打开(无感知差异)
## 结构
```text
dsh-trashbin/
├── package.json # dsh.bundle.patch + dsh.client 双面声明
├── cordis.patch.yml # 注册 trashbin 行到 profile
├── install.ps1 # 安装脚本(备份+回滚)
├── uninstall.ps1 # 卸载脚本
└── lib/
├── index.js # host 半边:/trash/unarchive 路由 + 存储域写入
└── client.js # browser 半边:回收站按钮 + 面板 UI + localStorage 状态
```
## License
[MIT](LICENSE)
*为 DSH 社区与昭瑜自制 🐟*Install
dsh plugin --profile web add github:SUJIElearning/dsh-trashbin
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 huangzhaoyu-dsh-trashbin from the hub
- This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.