deerflow-code/offline-backend-20260512/backend/packages/harness/deerflow/persistence/position_roles/base.py
2026-09-07 18:24:55 +08:00

31 lines
924 B
Python

"""Abstract storage for position-roundtable role configuration."""
from __future__ import annotations
from abc import ABC, abstractmethod
from typing import Any
class PositionRoleStore(ABC):
"""Global configuration shared by every position-roundtable session."""
@abstractmethod
async def list_roles(self) -> list[dict[str, Any]]:
"""Return roles in presentation order."""
raise NotImplementedError
@abstractmethod
async def replace_all(
self,
rows: list[dict[str, Any]],
*,
updated_by: str | None = None,
) -> list[dict[str, Any]]:
"""Atomically replace the editable role directory."""
raise NotImplementedError
@abstractmethod
async def ensure_seed(self, rows: list[dict[str, Any]]) -> list[dict[str, Any]]:
"""Insert only missing built-in roles, without overwriting edits."""
raise NotImplementedError