30 lines
741 B
Python
30 lines
741 B
Python
"""External integration contracts. Workspace does not own blobs or notification delivery."""
|
|
|
|
from dataclasses import dataclass
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class FileStorageContract:
|
|
available: bool
|
|
status: str
|
|
mode: str = "reference_only"
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class NotificationContract:
|
|
available: bool
|
|
status: str
|
|
mode: str = "persisted_only"
|
|
|
|
|
|
def file_storage_state(base_url: str | None) -> FileStorageContract:
|
|
ready = bool(base_url)
|
|
return FileStorageContract(
|
|
available=ready,
|
|
status="ready" if ready else "unavailable",
|
|
)
|
|
|
|
|
|
def notification_state() -> NotificationContract:
|
|
return NotificationContract(available=False, status="persisted_only")
|