Qintsg/dsh-safe-delete2

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.

AI 분석

核心用途是防止智能体在执行删除任务时误删重要本地文件。适合需要让AI协助管理文件系统,但又担心误操作导致数据丢失的用户。

패키지
dsh-safe-delete
버전
0.1.11
라이선스
Apache-2.0
최근 업데이트
2026. 8. 13.

설치

검증된 bundle이 없거나 호환성 검사에 실패했습니다. 먼저 저장소 설명을 읽어 주세요. 전체 README 읽기 ↗

Usage

The plugin registers four agent tools:

ToolDescription
safe_deleteMove paths into the trash (restorable). recursive: true for directories; permanent: true to delete irreversibly (requires approval).
trash_listList trash entries, optionally filtered by pattern (*.tmp).
restoreRestore entries by ids or pattern back to their original paths. onConflict: rename (default) / skip / overwrite.
purgePermanently 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) | Size cap; oldest entries are swept first; `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`. |
| `interceptFsDelete` | boolean | `false` | Reserved: intercept future `ctx.fs` delete methods. |