"""Agent Context Token (ACT) — Reference Implementation.

A JWT-based format for autonomous AI agents that unifies authorization
and execution accountability in a single token lifecycle.

Reference: draft-nennemann-act-00.
"""

from .errors import (
    ACTAudienceMismatchError,
    ACTCapabilityError,
    ACTDAGError,
    ACTDelegationError,
    ACTError,
    ACTExpiredError,
    ACTKeyResolutionError,
    ACTLedgerImmutabilityError,
    ACTPhaseError,
    ACTPrivilegeEscalationError,
    ACTSignatureError,
    ACTValidationError,
)
from .token import (
    ACTMandate,
    ACTRecord,
    Capability,
    Delegation,
    DelegationEntry,
    ErrorClaim,
    Oversight,
    TaskClaim,
    decode_jws,
    encode_jws,
    parse_token,
)
from .crypto import (
    ACTKeyResolver,
    KeyRegistry,
    PublicKey,
    PrivateKey,
    X509TrustStore,
    b64url_sha256,
    compute_sha256,
    did_key_from_ed25519,
    generate_ed25519_keypair,
    generate_p256_keypair,
    resolve_did_key,
    sign,
    verify,
)
from .lifecycle import transition_to_record
from .delegation import (
    create_delegated_mandate,
    verify_capability_subset,
    verify_delegation_chain,
)
from .dag import validate_dag, ACTStore
from .ledger import ACTLedger
from .verify import ACTVerifier
from .vectors import generate_vectors, validate_vectors

__all__ = [
    # Errors
    "ACTError",
    "ACTValidationError",
    "ACTSignatureError",
    "ACTExpiredError",
    "ACTAudienceMismatchError",
    "ACTCapabilityError",
    "ACTDelegationError",
    "ACTDAGError",
    "ACTPhaseError",
    "ACTKeyResolutionError",
    "ACTLedgerImmutabilityError",
    "ACTPrivilegeEscalationError",
    # Token structures
    "ACTMandate",
    "ACTRecord",
    "TaskClaim",
    "Capability",
    "Delegation",
    "DelegationEntry",
    "Oversight",
    "ErrorClaim",
    # Token serialization
    "encode_jws",
    "decode_jws",
    "parse_token",
    # Crypto
    "generate_ed25519_keypair",
    "generate_p256_keypair",
    "sign",
    "verify",
    "compute_sha256",
    "b64url_sha256",
    "resolve_did_key",
    "did_key_from_ed25519",
    "KeyRegistry",
    "X509TrustStore",
    "ACTKeyResolver",
    "PublicKey",
    "PrivateKey",
    # Lifecycle
    "transition_to_record",
    # Delegation
    "create_delegated_mandate",
    "verify_capability_subset",
    "verify_delegation_chain",
    # DAG
    "validate_dag",
    "ACTStore",
    # Ledger
    "ACTLedger",
    # Verify
    "ACTVerifier",
    # Vectors
    "generate_vectors",
    "validate_vectors",
]
