Cloud Storage
Layer 1: filesystem-style access to the user's own cloud.
Paths are relative and /-separated (notes/2026-09.json). iCloud stores them as nested files; Google Drive app-data is flat, so the path string is used verbatim as the file name. Every write is complete-or-absent from a reader's point of view. All functions are safe to call from any dispatcher; they never block the main thread.
Failures throw CloudStorageException. remoteId parameters are optional hints that save a list round trip on Drive; iCloud ignores them.
Inheritors
Functions
Cheap. Never touches the network.
Downloads into toLocalPath, replacing it. Throws CloudError.NotFound when absent.
Stable per (device, cloud account) when the platform can tell, so a sync engine can detect an account switch. Null on Drive, where the engine keys identity off the marker file's id.
Every file, deduplicated by path (newest wins).