from __future__ import annotations

from dataclasses import dataclass, field
from typing import Any, Literal


StatelessScope = Literal["global", "serialized", "local"]


@dataclass(frozen=True)
class StatelessOpConfig:
    scope: StatelessScope
    deterministic: bool | None = None
    side_effects: bool | None = None
    cost_hint: str | None = None
    batchable: bool | None = None
    timeout_ms: int | None = None
    metadata: dict[str, Any] = field(default_factory=dict)


@dataclass(frozen=True)
class StatelessOpRef:
    op_id: str
    scope: StatelessScope
    name: str | None = None
    module: str | None = None
    qualname: str | None = None
    origin: str | None = None
    config: StatelessOpConfig | None = None


__all__ = ["StatelessOpConfig", "StatelessOpRef", "StatelessScope"]
