Protocol for pluggable memory backends (single, unified).
Backends can store files in different locations (state, filesystem, database, etc.) and provide a uniform interface for file operations.
All file data is represented as objects with the FileData structure.
Methods can return either direct values or Promises, allowing both synchronous and asynchronous implementations.
interface BackendProtocolV1Delete a path, recursively removing anything nested under it.
This method is optional. Backends that do not implement it should omit it; callers that need broad backend compatibility should check for support before calling.
Download multiple files. Optional - backends that don't support file download can omit this.
Edit a file by replacing string occurrences.
Structured glob matching returning FileInfo objects.
Search file contents for a literal text pattern.
Binary files (determined by MIME type) are skipped.
Structured listing with file metadata.
Lists files and directories in the specified directory (non-recursive). Directories have a trailing / in their path and is_dir=true.
Read file content.
Read file content as raw FileData.
Upload multiple files. Optional - backends that don't support file upload can omit this.
Write content to a file, creating it or overwriting it if it already exists.