Agent Sandbox Registry

python-sdk

Decision: Filesystem Protocol (L2, Connect)

无中文版

.agents/notes/implemented/feature/2026-09-02-protocol-filesystem.md

Decision: Filesystem Protocol (L2, Connect)

Status: implemented Implemented: 2026-09-02

Problem

File operations use Connect protocol. Need typed protocol layer for filesystem management in sandboxes.

Decision

protocol/filesystem.py implements Connect RPC endpoints: - list_files(path) → list[FileInfo] - file_exists(path) → bool - get_file_info(path) → FileInfo - read_file(path) → bytes - write_file(path, data) → None - make_dir(path) → None - remove(path) → None - rename(old_path, new_path) → None - watch_dir(path) → AsyncIterator[FileEvent] (streaming)

Binary file content transferred as base64-encoded strings in JSON.

API Design

async def list_files(path: str) -> list[FileInfo]: ...
async def file_exists(path: str) -> bool: ...
async def get_file_info(path: str) -> FileInfo: ...
async def read_file(path: str) -> bytes: ...
async def write_file(path: str, data: bytes) -> None: ...
async def make_dir(path: str) -> None: ...
async def remove(path: str) -> None: ...
async def rename(old_path: str, new_path: str) -> None: ...
def watch_dir(path: str) -> AsyncIterator[FileEvent]: ...
# Binary content is base64-encoded within JSON payloads.

Implementation

Alternatives considered

Dependencies

Test Strategy

Acceptance criteria