Skills Plugins MCP Prompt Model 导航 博客 资讯 我的中心

dsh-session-cleanup

DeepSeek Harness plugin for interactive session cleanup and /nix, inspired by pi-session-cleanup.

hyein-cbio @hyein-cbio ⬇ 1 ★ 0 main

安装

dsh plugin --profile web add github:hyein-cbio/dsh-session-cleanup
下载安装清单

需要可复现安装时,可在仓库后追加 #commit 固定提交。

DeepSeek Harness plugin for interactive session cleanup and /nix, inspired by pi-session-cleanup.

该插件未提供要点说明,请参考仓库 README。

  1. 安装并启动 DeepSeek Harness:npx @deepseek-ai/dsh web
  2. 在终端执行上面的安装命令(CLI 会解析插件并核验来源)
  3. 用 dsh plugins list 确认已安装,必要时重启 Harness 生效

插件以当前 dsh 进程的权限运行,安装时可能执行代码。请先通读仓库源码与许可证,确认无破坏性命令与越权访问;本站只做索引,不对第三方插件安全性作担保。

代码仓库github.com/hyein-cbio/dsh-session-cleanup
许可证MIT
主要语言main
下载量1
GitHub 星标0
最近推送2026-08-19
收录日期2026-09-19
分类会话与消息

事实信息来自公开插件目录快照(2026-10-01),介绍文案由本站再加工。

以下为插件仓库 README 全文(原始内容,由公开目录抓取整理)。

# dsh-session-cleanup

Interactive session cleanup for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness).

Inspired by [pi-session-cleanup](https://github.com/MasuRii/pi-session-cleanup), ported to DSH so sessions can be listed and removed through official host services instead of Pi JSONL files.

## What this is

This is a **DSH plugin**, verified on the `pi-tui` profile. It is inspired by MasuRii's Pi extension, but it is not a drop-in Pi package.

On DSH it:

- lists sessions with `sessionPersistence.listSnapshots()` + `locate()`
- deletes through the host cleanup chain: stop / flush / detach, then the session directory, projection cache, workspace accounting, and pi2dsh sidecar
- sends the session directory to **Trash on macOS**, and uses `rm -rf` on other platforms

Deletion is the whole session directory (and sidecar), not a single `session.jsonl.zstd`. The leftover Pi trash/unlink path refuses those DSH artifacts so it cannot leave a hole in persistence.

## Installation

```bash
dsh plugin --profile pi-tui add dsh-session-cleanup
```

From this repo, or a local checkout, the package must ship compiled JS (`lib/dsh-entry.js`):

```bash
npm run build
dsh plugin --profile pi-tui add file:$PWD
```

Restart the profile. Confirm it loaded:

```bash
dsh --profile pi-tui --dump-config | grep session-cleanup
dsh --profile pi-tui
```

Currently tested on **`pi-tui`**. Other terminals or the web profile are not guaranteed. The web profile already has a dedicated session-delete plugin.

## Commands

| Command | Arguments | Description |
|---------|-----------|-------------|
| `/session-cleanup` | — | List orphaned sessions (cwd directory is gone) |
| `/session-cleanup orphaned` | — | Same as default |
| `/session-cleanup current` | — | Sessions from the current working directory |
| `/session-cleanup all` | — | All persisted sessions |
| `/session-cleanup delete` | `` | Delete those session ids after confirmation |
| `/session-cleanup help` | — | Usage |
| `/nix` | — | Create a new DSH session, then delete the current one |
| `/nix agent` | `[preset]` | Same, with a selected or named agent preset |
| `/nix quit` | — | Delete the current session and exit DSH |
| `/nix help` | — | `/nix` usage |

With a `userQuestions` service (pi-tui has one), `/session-cleanup` opens a multi-select + confirm flow. Without one, it prints the list and you delete by id.

`/` autocomplete in pi-tui shows the argument grammar in the command description. After-space completions (`orphaned`, `quit`, …) need a host-side `argumentHint` hook and are not wired yet.

## `/nix` on DSH

`/nix` is destructive and asks for confirmation.

- **`/nix`** creates a new session with `ctx.agents.create` (or `ctx.sessions.create`) using the current cwd and preset, then deletes the previous session.
- **`/nix agent [preset]`** does the same with a DSH agent preset. Without `[preset]`, it opens a picker.
- **`/nix quit`** deletes the current session, disposes the root fiber, and `process.exit(0)`.

DSH has no host-level “current session pointer”. After `/nix`, the TUI may keep showing the old conversation until you resume the new id:

```text
dsh --profile pi-tui --resume
```

## Safety

1. **Active session excluded** from the cleanup list
2. **Confirm before delete**
3. **macOS Trash** for session directories; other platforms permanently remove them
4. **Cleanup order** — disk/log removal is confirmed before workspace accounting is stripped
5. **Both id spellings** — `` and `session-`

## Development

```bash
npm run build    # emit lib/dsh-entry.js for DSH
npm run test     # test suite
npm run check    # build + test
```

Native DSH entry: `dsh-entry.ts` → `lib/dsh-entry.js`. That graph does not import Pi packages.

Stock **pi2dsh** (remote main) is enough for this plugin. A patched pi2dsh is only needed if you load the leftover Pi extension path instead of the native DSH commands.

## Attribution

Command names, scopes, and the `/nix` idea come from [pi-session-cleanup](https://github.com/MasuRii/pi-session-cleanup) (MIT © MasuRii). The DSH port uses DeepSeek Harness persistence, workspace accounting, and agent presets.

## License

[MIT](LICENSE)

数据来源:公开的 DeepSeek Harness 插件目录与各插件 GitHub 仓库。本站为独立第三方目录,与 DeepSeek、幻方(High-Flyer)及插件作者均无隶属或背书关系。

每日精选 Skill 推荐,免费送到你邮箱

输入邮箱,每天接收一个精选 AI Agent 技能推荐。完全免费,持续更新。

提交后我们会发送一封确认邮件,点击邮件里的链接才会开始收信。

完全免费,取消任意时间。我们不会发送垃圾邮件。