from dataclasses import dataclass
from enum import StrEnum

from a2a.server.agent_execution import RequestContext


class Illocution(StrEnum):
    """Illocutions that are used in messages.
    * TELL, ACHIEVE, ASK are basic illocutions inspired by KQML.
    * PROPOSE is suited for arbitration or consensus.
    * UPLOAD is suited for data transfer.
    * FAILURE is to be used to report a failure in operation.
    """

    TELL = "tell"
    ACHIEVE = "achieve"
    ASK = "ask"
    PROPOSE = "propose"
    UPLOAD = "upload"
    FAILURE = "failure"


@dataclass
class ACLMessage:
    illocution: Illocution
    content: str
    sender: str
    codec: str


@dataclass
class ACLIncomingMessage(ACLMessage):
    task_id: str
    origin: RequestContext
