DSH Plugins
返回列表
🧩

dsh-plugin-recycle-bin

admin-security 更新于 2026.08.30

在终端中运行以下命令:

dsh plugin install Xylocarpro/dsh-plugin-recycle-bin

将以下提示词粘贴到 DeepSeek Harness 对话框中:

运行 dsh plugin install Xylocarpro/dsh-plugin-recycle-bin 即可在 DeepSeek Harness 中安装此插件,完整源码地址:https://github.com/Xylocarpro/dsh-plugin-recycle-bin

插件介绍

When an AI agent runs local file operations on Windows, one of the biggest risks is that the model may emit a del, Remove-Item, shred, or sdelete command that wipes files straight from disk. There is no Recycle Bin to fall back on, and a single instruction to empty it makes the loss permanent and unrecoverable. dsh-plugin-recycle-bin exists to close exactly that gap.

The plugin works at three levels. First, it wraps every shell invocation (PowerShell, bash, foreground and background) and matches destructive tokens by command position—so $rm, form, and other look-alikes never trigger a false positive—blocking del, rm, Remove-Item, erase, sdelete, shred, cipher /w, unlink, and similar commands before they ever spawn. Second, it offers the file_trash tool, which routes each deletion through SendToRecycleBin into the system Recycle Bin, making permanent erasure mechanically impossible within the agent's tool path. Third, it measures free disk space via fs.statfsSync (with a Get-PSDrive fallback) and, when the remaining space drops below a configurable threshold, pauses the operation and asks the user to free up space and retry, force-recycle anyway, or cancel. It also forbids Clear-RecycleBin and any deletion targeting the Recycle Bin folder itself. A trash_status tool lets the agent report Recycle Bin support, remaining versus total space, and the safety threshold at any time.

The plugin is ideal for developers and teams who run DSH agents on Windows to tidy project folders, clean up build artefacts, or perform bulk file operations while still wanting every deletion to be recoverable. If your agent needs the ability to delete files but every single one of those deletions must remain reachable from the Recycle Bin, this plugin is the guardrail you want in front of the shell.

使用场景

  • AI agent 在 Windows 上执行批量文件清理时确保所有删除可恢复到回收站
  • 在 agent 工具调用中拦截 del、rm、Remove-Item、sdelete 等不可逆磁盘擦除命令
  • 磁盘剩余空间低于阈值时自动暂停删除并询问用户放空间、强制回收或取消

适合人员

  • 在 Windows 上运行 DSH agent 进行文件管理任务的开发者
  • 需要为 AI agent 的文件删除操作设置安全边界的团队
  • 希望 agent 具备删除能力但要求每次操作都必须可从回收站恢复的用户