"""persistence - Flat, simple storage layer.

Core components:
    from persistence.store import StudioStore, FileStudioStore, FileStudioStoreConfig
    from persistence.service import StudioDomainService
    from persistence.models import Document, Workspace, Project, Folder, ...
    from persistence.errors import NotFoundError, ValidationError, ConflictError

For agent memory, use the memory.* tools instead:
    - memory.set(key, value, namespace)
    - memory.get(key, namespace)
    - memory.search(query, namespace)
"""

# Re-export commonly used items for convenience
from persistence.errors import (
    ConflictError,
    NotFoundError,
    PersistenceError,
    ValidationError,
)
from persistence.models import (
    ApplyPatchResult,
    DocType,
    Document,
    Folder,
    Patch,
    PathwayGraphOp,
    PathwayGraphOpsPatch,
    Project,
    Revision,
    RunEvent,
    RunStatus,
    RunSummary,
    SnapshotPatch,
    TreeChildren,
    TreeDocumentNode,
    TreeFolderNode,
    Workspace,
    WorkspaceTree,
)
from persistence.service import StudioDomainService
from persistence.store import (
    CommitPatchResult,
    FileStudioStore,
    FileStudioStoreConfig,
    PatchIdempotencyRecord,
    StudioStore,
    ThreadRecord,
)

__all__ = [
    "ApplyPatchResult",
    "CommitPatchResult",
    "ConflictError",
    # Models
    "DocType",
    "Document",
    "FileStudioStore",
    "FileStudioStoreConfig",
    "Folder",
    "NotFoundError",
    "Patch",
    "PatchIdempotencyRecord",
    "PathwayGraphOp",
    "PathwayGraphOpsPatch",
    # Errors
    "PersistenceError",
    "Project",
    "Revision",
    "RunEvent",
    "RunStatus",
    "RunSummary",
    "SnapshotPatch",
    # Service
    "StudioDomainService",
    # Store
    "StudioStore",
    "ThreadRecord",
    "TreeChildren",
    "TreeDocumentNode",
    "TreeFolderNode",
    "ValidationError",
    "Workspace",
    "WorkspaceTree",
]
