from typing import Literal, NotRequired

from typing_extensions import TypedDict

LineageRole = Literal["current", "proposed", "history"]
RevisionStatus = Literal["pending", "accepted", "rejected", "superseded"]


class ArtifactReferenceMetadata(TypedDict):
    messageId: str
    artifactsId: str
    artifactIndex: int


class DocumentSourceStateMetadata(TypedDict):
    lineageRole: LineageRole
    revisionStatus: RevisionStatus


class AgentHubDocumentMetadata(TypedDict):
    lineageId: str
    lineageRole: LineageRole
    revisionStatus: RevisionStatus
    source: NotRequired[ArtifactReferenceMetadata]
    filename: NotRequired[str]
    mimeType: NotRequired[str]
    _sourceState: NotRequired[DocumentSourceStateMetadata]
