Files
deepagentsjs/evals/files
Hunter Lovell ba8d4aa716 feat(deepagents): add recursive delete tool (#675)
## Summary

This adds a destructive `delete` filesystem tool backed by the core backend protocol, with recursive deletion for files/directories and write-permission enforcement over the whole target subtree.

## Changes

### Core filesystem backends

- Added `DeleteResult` and optional `delete(filePath)` support to the
backend protocol and adapters.
- Implemented recursive delete behavior for state, store, filesystem,
sandbox, context-hub, and composite backends.
- Preserved filesystem path containment and symlink safety: filesystem
deletes remove symlinks as links and do not follow them.
- Converts unsupported routed deletes in `CompositeBackend` into normal
backend errors.

### Filesystem middleware

- Added the final `delete` tool name with recursive file/directory
semantics.
- Treats `delete` as a write operation for filesystem permissions.
- Refuses recursive deletes if any deny-write permission pattern
overlaps the target subtree, without enumerating filesystem contents
first.
- Filters the `delete` tool out when the resolved backend does not
support deletion.

### Tests, evals, and prompts

- Added backend and middleware coverage for recursive deletes, missing
paths, symlink safety, unsupported backends, and permission denial.
- Added file-operation eval coverage for deleting a file and deleting a
directory recursively.
- Updated core filesystem prompts and sandbox examples to document the
new `delete` tool.
2026-08-18 20:04:11 -07:00
..

files

File operation evals — read, write, edit, ls, grep, glob, parallel I/O.