LeonSone/dsh-trash0

dsh-trash

DSH 回收站插件:最高权限下所有删除操作一律拦截并转入回收站,误删可一键恢复。Intercepts every delete operation (Remove-Item/rm/del/fs.unlink/...) and redirects it to a recoverable trash store.

包名
dsh-trash
版本
0.1.0
许可证
MIT
最近更新
2026年8月22日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:LeonSone/dsh-trash

Usage

Once installed, the model's behavior changes automatically:

ScenarioBehavior
Model runs Remove-Item / rm / del / …Blocked with a message explaining the trash workflow
Model calls trash(paths=[...])Files/dirs move into the trash (recoverable)
Accidental deletetrash-restore(entry_id=...) restores to the original path; or trash-restore(path="") finds the newest matching entry
Permanent cleanuptrash-purge(confirm: true) — optionally scoped to specific entry_ids

Tool reference

ToolPurpose
trash(paths, reason?)Move files/directories into the trash. Returns entry_id, trash_root, moved.
trash-list(path?)List trash entries (deleted-at, size, reason, original paths). Optional substring filter on the original path.
trash-restore(entry_id? | path?, target_path?, overwrite?)Restore an entry to its original location (or target_path for single-item entries). If the target exists, it refuses unless overwrite: true — in which case the existing content is first moved to the trash itself, then the restore proceeds. Nothing is ever lost.
trash-purge(entry_ids?, confirm: true)Permanently delete trash entries. The only real deletion in the whole plugin.

Configuration (optional)

Append to your profile's cordis.patch.yml:

- id: dsh-trash
  config:
    location: D:/data/dsh-trash   # trash root; same drive as the workspace = instant renames
    interceptPwsh: true           # intercept deletes in pwsh (default true)
    interceptBash: true           # intercept deletes in bash (default true)
    interceptRunCode: true        # intercept fs.* deletes in run_code (default true)