Add `volumes` to protocol
Closed
SA
2mo ago+1375+1375+0123456789012345678901234567890123456789-105-105-012345678901234567890123456789
Summary by cubic
Adds volumes to the wire protocol so a serving relay (monty-server) can mount directories from its own store into a session's sandbox and serve their filesystem calls itself, requested at checkout instead of via upgrade headers.
Protocol
Configurenow carries repeatedRemoteVolumes (virtual path, UUID, mode, eager entries, optional name, size and operation limits); children ignore them, so no protocol version bump.- The subprocess transport and WASM runtime have no store and refuse or drop volumes.
Python client
- New
RemoteVolumeclass andAsyncMontyWebsocket.checkout(volumes=...)accepts one or a sequence; mounts ride onConfigureand are re-sent on resume. RemoteVolumewithout anidgenerates one withuuid.uuid4(); read it back fromidto mount the same volume again.- Mode defaults to
overlay, matchingMountDir;overlaywrites belong to the connection (survive feeds, never stored), unlikeMountDir's feed-scoped overlay. The three limits (size_limit,write_operations_limit,read_operations_limit) take the server's default whenNone. eagerentries are files orPath.globpatterns; a trailing/loads everything beneath a directory,/alone loads the whole volume, and an entry matching nothing fails the checkout.- The constructor rejects non-absolute and NUL-containing virtual paths, names over 128 bytes or with control characters, and
__repr__escapes its strings. monty_fs::path_securityis now public so a relay serving its own mounts applies the same path policy, including mount-prefix matching.