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.
LocalWorkspace
Section titled “LocalWorkspace”from cayu.workspaces import LocalWorkspaceFilesystem 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.
Fields and attributes
Section titled “Fields and attributes”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 |
reference_binding (method)
Section titled “reference_binding (method)”LocalWorkspace.reference_binding() -> WorkspaceReferenceBindingBind 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.
read_bytes (method)
Section titled “read_bytes (method)”async LocalWorkspace.read_bytes(path: str, *, offset: int=0, max_bytes: int | None=None) -> WorkspaceReadResultbounded_read_limit (method)
Section titled “bounded_read_limit (method)”LocalWorkspace.bounded_read_limit(max_bytes: int) -> intwrite_bytes (method)
Section titled “write_bytes (method)”async LocalWorkspace.write_bytes(path: str, content: bytes) -> Nonedelete (method)
Section titled “delete (method)”async LocalWorkspace.delete(path: str) -> Nonecreate_bytes (method)
Section titled “create_bytes (method)”async LocalWorkspace.create_bytes(path: str, content: bytes) -> WorkspaceMutationResultreplace_bytes (method)
Section titled “replace_bytes (method)”async LocalWorkspace.replace_bytes(path: str, content: bytes, *, expected_revision: str) -> WorkspaceMutationResultdelete_if_revision (method)
Section titled “delete_if_revision (method)”async LocalWorkspace.delete_if_revision(path: str, *, expected_revision: str) -> WorkspaceMutationResultrequire_absent (method)
Section titled “require_absent (method)”async LocalWorkspace.require_absent(path: str) -> Nonemove_if_revision (method)
Section titled “move_if_revision (method)”async LocalWorkspace.move_if_revision(source_path: str, destination_path: str, *, expected_source_revision: str, require_destination_absent: bool=True) -> WorkspaceMoveResultlist (method)
Section titled “list (method)”async LocalWorkspace.list(pattern: str='**/*', *, limit: int | None=None) -> WorkspaceListResultlist_git_entries (method)
Section titled “list_git_entries (method)”async LocalWorkspace.list_git_entries(*, limit: int) -> WorkspaceGitEntryListResultresource_key (property)
Section titled “resource_key (property)”LocalWorkspace.resource_key() -> tuple[object, ...]tar_copy_policy_identity (method)
Section titled “tar_copy_policy_identity (method)”LocalWorkspace.tar_copy_policy_identity() -> tuple[object, ...]bounded_tar_stream_reader (method)
Section titled “bounded_tar_stream_reader (method)”LocalWorkspace.bounded_tar_stream_reader() -> BoundedTarStreamReader | NoneReturn an explicit bounded streaming-tar reader capability, if any.
tar_stream_writer (method)
Section titled “tar_stream_writer (method)”LocalWorkspace.tar_stream_writer() -> TarStreamWriter | NoneReturn an explicit streaming-tar writer capability, if any.
branch_capabilities (method)
Section titled “branch_capabilities (method)”LocalWorkspace.branch_capabilities() -> WorkspaceBranchCapabilitiesbranch_lifecycle_summary (method)
Section titled “branch_lifecycle_summary (method)”LocalWorkspace.branch_lifecycle_summary() -> WorkspaceBranchLifecycleSummarycreate_branch (method)
Section titled “create_branch (method)”async LocalWorkspace.create_branch(request: WorkspaceBranchRequest) -> WorkspaceBranchCreationResultwrite_bytes_with_git_mode (method)
Section titled “write_bytes_with_git_mode (method)”async LocalWorkspace.write_bytes_with_git_mode(path: str, content: bytes, *, git_mode: WorkspaceGitMode) -> Nonecreate_bytes_with_git_mode (method)
Section titled “create_bytes_with_git_mode (method)”async LocalWorkspace.create_bytes_with_git_mode(path: str, content: bytes, *, git_mode: WorkspaceGitMode) -> WorkspaceMutationResultreplace_bytes_with_git_mode (method)
Section titled “replace_bytes_with_git_mode (method)”async LocalWorkspace.replace_bytes_with_git_mode(path: str, content: bytes, *, expected_revision: str, expected_git_mode: WorkspaceGitMode, git_mode: WorkspaceGitMode) -> WorkspaceMutationResultprune_empty_directories (method)
Section titled “prune_empty_directories (method)”async LocalWorkspace.prune_empty_directories(path: str, *, max_directories: int) -> Noneinit (method)
Section titled “init (method)”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) -> Nonerequire_path_operations_supported (method)
Section titled “require_path_operations_supported (method)”LocalWorkspace.require_path_operations_supported() -> NoneRequire the primitives used by secure path-addressed operations.
recover_branch (method)
Section titled “recover_branch (method)”async LocalWorkspace.recover_branch(request: WorkspaceBranchRecoveryRequest) -> WorkspaceBranchRecoveryResultRecover one durable local branch from store and filesystem evidence.
resolve (method)
Section titled “resolve (method)”LocalWorkspace.resolve(path: str) -> Pathresolve_no_symlinks (method)
Section titled “resolve_no_symlinks (method)”LocalWorkspace.resolve_no_symlinks(path: str) -> Path