Add safe delete Native Plugin example - #312
Merged
Merged
Conversation
This was referenced Sep 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add an optional
safe_deleteNative Tool Plugin example that moves one file or directory under the configured Plugincwdto the operating-system Trash / Recycle Bin instead of permanently deleting it.gio trash, thentrash-putonly whengiois unavailableNSFileManagerTrash API through built-in JXA, without Finder UI automationMicrosoft.VisualBasic.FileIORecycle Bin backendReviewer hardening
Independent review fixed two replay/outcome issues before publication:
safe_deleteis now explicitly non-idempotent. An already-absent path is a safe no-op, but after an unknown result a replacement object may appear at the same name, so callers must not blindly retry.outcome=unknownrather than a definite failure.The review branch was rebuilt directly from current
origin/mainso an unrelated local tunnel-diagnostics commit is not part of this PR.Validation
node --check plugins/safe-delete/plugin.mjsnode --test plugins/safe-delete/plugin.test.mjs— 16/16 passedpython3 scripts/check_markdown_links.py— 0 missing linksgit diff --check origin/main...HEADThe example tests are intentionally not wired into a new CI lane in this PR; the current goal is an optional dogfood Plugin, and adding CI workflow/release-gate changes would trigger the full native matrix. Real Runner/OS Trash behavior will be dogfooded after deployment.