from __future__ import annotations

from abc import ABC, abstractmethod
from dataclasses import dataclass
from dataclasses import field
from typing import TYPE_CHECKING

from app.schemas.changeset import ChangeItem

if TYPE_CHECKING:
    from app.core.agent.runtime.execution_context import RuntimeExecutionContext


@dataclass(slots=True)
class ProcessResult:
    answer: str = ""
    changeset: list[ChangeItem] = field(default_factory=list)
    apply_changeset: bool = False


class AgentProcess(ABC):
    version = ""

    @abstractmethod
    async def run(self, context: "RuntimeExecutionContext") -> ProcessResult:
        raise NotImplementedError
