Skip to content

cayu.workspaces.local

Public Cayu API. Definitions are grouped by their public source module, and definitions from private implementation modules appear on their package’s page; adding a symbol does not move existing links. The import shown at each entry is a supported public namespace. Read the Python API overview and install the required extra.

from cayu.workspaces import LocalWorkspace

Filesystem workspace rooted at one local directory.

excluded_directory_names and excluded_path_patterns remove matching paths from listing and reject every direct read, resolution, or mutation. This opt-in projected view does not advertise workspace branching because a branch must not regain access to excluded source authority.

Bases: Workspace, WorkspaceGitModeMutator, WorkspaceDirectoryPruner.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
id str required
LocalWorkspace.reference_binding() -> WorkspaceReferenceBinding

Bind application data to this workspace incarnation.

The default is object-lifetime scoped and fails closed after reopening. Durable adapters may override this method only when they can preserve an incarnation across recovery and rotate it on replacement. Never restore a generation from the application reference being validated.

async LocalWorkspace.read_bytes(path: str, *, offset: int=0, max_bytes: int | None=None) -> WorkspaceReadResult
LocalWorkspace.bounded_read_limit(max_bytes: int) -> int
async LocalWorkspace.write_bytes(path: str, content: bytes) -> None
async LocalWorkspace.delete(path: str) -> None
async LocalWorkspace.create_bytes(path: str, content: bytes) -> WorkspaceMutationResult
async LocalWorkspace.replace_bytes(path: str, content: bytes, *, expected_revision: str) -> WorkspaceMutationResult
async LocalWorkspace.delete_if_revision(path: str, *, expected_revision: str) -> WorkspaceMutationResult
async LocalWorkspace.require_absent(path: str) -> None
async LocalWorkspace.move_if_revision(source_path: str, destination_path: str, *, expected_source_revision: str, require_destination_absent: bool=True) -> WorkspaceMoveResult
async LocalWorkspace.list(pattern: str='**/*', *, limit: int | None=None) -> WorkspaceListResult
async LocalWorkspace.list_git_entries(*, limit: int) -> WorkspaceGitEntryListResult
LocalWorkspace.resource_key() -> tuple[object, ...]
LocalWorkspace.tar_copy_policy_identity() -> tuple[object, ...]
LocalWorkspace.bounded_tar_stream_reader() -> BoundedTarStreamReader | None

Return an explicit bounded streaming-tar reader capability, if any.

LocalWorkspace.tar_stream_writer() -> TarStreamWriter | None

Return an explicit streaming-tar writer capability, if any.

LocalWorkspace.branch_capabilities() -> WorkspaceBranchCapabilities
LocalWorkspace.branch_lifecycle_summary() -> WorkspaceBranchLifecycleSummary
async LocalWorkspace.create_branch(request: WorkspaceBranchRequest) -> WorkspaceBranchCreationResult
async LocalWorkspace.write_bytes_with_git_mode(path: str, content: bytes, *, git_mode: WorkspaceGitMode) -> None
async LocalWorkspace.create_bytes_with_git_mode(path: str, content: bytes, *, git_mode: WorkspaceGitMode) -> WorkspaceMutationResult
async LocalWorkspace.replace_bytes_with_git_mode(path: str, content: bytes, *, expected_revision: str, expected_git_mode: WorkspaceGitMode, git_mode: WorkspaceGitMode) -> WorkspaceMutationResult
async LocalWorkspace.prune_empty_directories(path: str, *, max_directories: int) -> None
LocalWorkspace.__init__(root: str | Path, *, workspace_id: str | None=None, excluded_directory_names: Iterable[str]=(), excluded_path_patterns: Iterable[str]=(), branch_store: WorkspaceBranchStore | None=None, branch_authority_resolver: WorkspaceBranchBindingAuthorityProvider | None=None) -> None

require_path_operations_supported (method)

Section titled “require_path_operations_supported (method)”
LocalWorkspace.require_path_operations_supported() -> None

Require the primitives used by secure path-addressed operations.

async LocalWorkspace.recover_branch(request: WorkspaceBranchRecoveryRequest) -> WorkspaceBranchRecoveryResult

Recover one durable local branch from store and filesystem evidence.

LocalWorkspace.resolve(path: str) -> Path
LocalWorkspace.resolve_no_symlinks(path: str) -> Path

Release source · Runtime guarantees · Capability guides