dsh-safe-delete
Safe delete plugin for DeepSeek Harness (DSH): move files to trash / staging area instead of permanent removal, with restore and purge support. 适合需要防止Agent误删文件,提供可恢复的暂存区与安全审计机制的用户。
Other repositories with this package name
Install
This plugin has no verified bundle, or compatibility checks failed. Read the repository notes first. Read the full README ↗
README
Read the full README ↗Usage
The plugin registers four agent tools:
| Tool | Description |
|---|---|
safe_delete | Move paths into the trash (restorable). recursive: true for directories; permanent: true to delete irreversibly (requires approval). |
trash_list | List trash entries, optionally filtered by pattern (*.tmp). |
restore | Restore entries by ids or pattern back to their original paths. onConflict: rename (default) / skip / overwrite. |
purge | Permanently delete trash entries (ids or all: true) — always requires approval. |
A system-prompt section guides the model to prefer safe_delete over rm / Remove-Item.
Escape hatch
When deleteHijack: block intercepts a delete command, the model can still delete permanently on purpose:
## Configuration
All options are editable live in **DSH Web → Settings → Plugins → Safe Delete** (card is localized to the DSH language).
| Option | Type | Default | Description |
|---|---|---|---|
| `trashDir` | string | `''` (workspace `.dsh-trash`, or `$DSH_HOME/.dsh-safe-delete-trash` without a workspace) | Trash root; must be an absolute path when set. |
| `retentionDays` | number | `30` | Auto-expire entries older than this; `0` disables. |
| `maxSizeBytes` | number | `5368709120` (5 GiB) | Trash size cap; deletions whose target exceeds it trigger the capacity guard (approval/block by permission); `0` disables. |
| `confirmThreshold` | number | `10` | Batch deletions at/above this count require approval; `0` always confirms. |
| `restoreConflict` | enum | `rename` | Default restore conflict strategy: `rename` / `skip` / `overwrite`. |
| `deleteHijack` | enum | `block` | Hijack delete commands in bash/pwsh: `block` / `ask` / `off` (`ssh`/`scp` remote commands always allowed). |
| `interceptFsDelete` | boolean | `false` | Reserved: intercept future `ctx.fs` delete methods. |