Bundle
dsh-plugin-session-batch-archive
为 DSH 会话列表提供多选与批量归档,并在提交前进行二次确认。
- Source
- antlordGit
- License
- MIT
- Updated
- Updated 3 days ago
Readme
# dsh-plugin-session-batch-archive · 会话批量归档
为 DeepSeek Harness Web 侧栏增加一个“批量归档”入口。点击后原生会话行前会出现复选框,可直接勾选多个会话,再经二次确认后批量归档。
## 效果展示
### 批量归档入口
插件在侧栏底部增加「批量归档」入口,不改变原有会话列表布局。

### 选择多个会话
进入多选模式后,会话标题前显示复选框,底部按钮实时显示已选数量。

### 二次确认
提交前会再次显示归档数量、会话标题和行为说明,避免误操作。

## 特性
- 使用 `sidebar.footer.action` 增量挂载,不替换原生会话列表
- 原生会话列表进入多选模式,复选框直接显示在会话标题前
- 同名会话通过原生拖拽契约读取真实 Session id,不按标题猜测
- 明确标记当前会话
- 提交前显示第二次确认和待归档标题清单
- 逐个调用 `workspaces.archiveSession(id)`,避免并发完整快照回声互相覆盖
- 部分失败时保留界面并列出失败项
- 使用 DSH 主题令牌,自动适配明暗主题
> DSH 的“归档”只会隐藏会话,不会删除日志。当前运行时没有查看或取消归档入口,确认框会明确提示这一限制。
## 构建
```bash
npm run build
```
## 安装方式
### 方式一:从 GitHub 在线安装
```bash
dsh plugin --profile web add github:antlordGit/dsh-plugin-session-batch-archive
dsh web
```
### 方式二:Git Clone 下载后安装
```bash
git clone https://github.com/antlordGit/dsh-plugin-session-batch-archive.git
cd dsh-plugin-session-batch-archive
npm install
npm run build
dsh plugin --profile web add "$(pwd)"
dsh web
```
两种方式任选其一。安装后重启 DSH Web,在侧栏底部点击“批量归档”,会话行前即出现复选框;勾选后点击底部“归档 N”进入二次确认。侧栏折叠时仅显示图标。
## 运行时契约
- `sidebar.footer.action`:批量归档入口
- `shell.overlay`:多选与确认对话框
- `useSessions`:会话列表、标题、当前会话和更新时间
- `useWorkspaces`:已归档集合
- `ctx.get('workspaces').archiveSession(id)`:公开归档动作
Install
dsh plugin --profile web add github:antlordGit/dsh-plugin-session-batch-archive
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-plugin-session-batch-archive from the hub
- This package builds from source on install. pnpm will ask you to allow its build script — that is permission to run the package’s code on your machine, outside the agent sandbox. Only allow sources you trust.
- This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.