"""EventGraph — hash-chained, append-only, causal event graph."""

from .authority import (
    AuthorityChain,
    AuthorityLink,
    AuthorityPolicy,
    AuthorityResult,
    DefaultAuthorityChain,
    matches_action,
)
from .actor import (
    Actor,
    ActorFilter,
    ActorStatus,
    ActorStore,
    ActorType,
    ActorUpdate,
    InMemoryActorStore,
)
from .bus import EventBus
from .decision import (
    AuthorityLevel,
    Branch,
    Condition,
    DecisionError,
    DecisionNode,
    DecisionOutcome,
    DecisionTree,
    EvaluateInput,
    EvolutionConfig,
    EvolutionResult,
    IDecisionMaker,
    IIntelligence,
    IntelligenceUnavailableError,
    InternalNode,
    LeafNode,
    LeafStats,
    MatchValue,
    NoOpIntelligence,
    Operator,
    PathStep,
    PatternResult,
    Response,
    TreeResult,
    TreeStats,
    detect_pattern,
    evaluate,
    evolve,
    extract_branch,
    extract_field,
    parse_outcome,
    test_condition,
)
from .errors import (
    ActorKeyNotFoundError,
    ActorNotFoundError,
    ChainIntegrityError,
    EmptyRequiredError,
    EventGraphError,
    EventNotFoundError,
    InvalidFormatError,
    InvalidTransitionError,
    OutOfRangeError,
    StoreError,
    ValidationError,
)
from .event import (
    Event,
    NoopSigner,
    Signer,
    canonical_content_json,
    canonical_form,
    compute_hash,
    create_bootstrap,
    create_event,
    new_event_id,
)
from .primitive import (
    LIFECYCLE_ACTIVE,
    LIFECYCLE_ACTIVATING,
    LIFECYCLE_DORMANT,
    LIFECYCLE_EMITTING,
    LIFECYCLE_MEMORIAL,
    LIFECYCLE_PROCESSING,
    LIFECYCLE_SUSPENDED,
    LIFECYCLE_SUSPENDING,
    AddEvent,
    Mutation,
    Primitive,
    PrimitiveState,
    Registry,
    Snapshot,
    UpdateActivation,
    UpdateLifecycle,
    UpdateState,
)
from .primitives import (
    ALL_PRIMITIVE_CLASSES,
    create_all_primitives,
)
from .grammar import Grammar
from .compositions import (
    AlignmentGrammar,
    ArbitrationResult,
    AuctionResult,
    BarterResult,
    BeingFarewellResult,
    BeingGrammar,
    BelongingGrammar,
    BetrayalRepairResult,
    BondFarewellResult,
    BondGrammar,
    BondMentorshipResult,
    BuildGrammar,
    CheckInResult,
    ClassActionResult,
    CommonsGovernanceResult,
    ConstitutionalAmendmentResult,
    ContemplationResult,
    CredentialResult,
    CulturalOnboardingResult,
    DelegateAndVerifyResult,
    DesignReviewResult,
    EscalateResult,
    EthicsAuditResult,
    EvolutionGrammar,
    ExileResult,
    ExistentialAuditResult,
    FactCheckResult,
    FederationResult,
    FestivalResult,
    ForecastResult,
    GuardrailResult,
    HealthCheckResult,
    IdentityAuditResult,
    IdentityGrammar,
    ImpactAssessmentResult,
    InjunctionResult,
    IntroductionResult,
    JusticeGrammar,
    KnowledgeBaseResult,
    KnowledgeGrammar,
    MarketGrammar,
    MarketSubscriptionResult,
    MeaningGrammar,
    MeaningMentorshipResult,
    MeaningPostMortemResult,
    MigrationResult,
    MilestoneResult,
    OnboardResult,
    PhaseTransitionResult,
    PipelineResult,
    PleaResult,
    PollResult,
    PostMortemResult,
    PruneResult,
    RecallResult,
    ReinventionResult,
    RenewalResult,
    ReputationTransferResult,
    RestorativeJusticeResult,
    RetirementResult,
    RetrospectiveResult,
    RefundResult,
    SchismResult,
    SelfEvolveResult,
    SocialGrammar,
    SpikeResult,
    SprintResult,
    StandupResult,
    SuccessionResult,
    SurveyResult,
    TechDebtResult,
    TransferResult,
    TriageResult,
    TrialResultJ,
    VerifyResult,
    WhistleblowResult,
    WorkGrammar,
)
from .graph import (
    AlreadyBootstrappedError,
    Graph,
    GraphClosedError,
    GraphConfig,
    GraphNotStartedError,
    Query,
)
from .sqlite_store import SQLiteStore
from .store import ChainVerification, InMemoryStore, Store
from .trust import DefaultTrustModel, TrustConfig, TrustMetrics
from .tick import TickConfig, TickEngine, TickResult
from .egip import (
    # Constants
    CURRENT_PROTOCOL_VERSION,
    MAX_ENVELOPE_AGE_SECONDS,
    DEDUP_PRUNE_INTERVAL,
    INTER_SYSTEM_DECAY_RATE,
    INTER_SYSTEM_MAX_ADJUSTMENT,
    TRUST_IMPACT_VALID_PROOF,
    TRUST_IMPACT_RECEIPT_ON_TIME,
    TRUST_IMPACT_TREATY_HONOURED,
    TRUST_IMPACT_TREATY_VIOLATED,
    TRUST_IMPACT_INVALID_PROOF,
    TRUST_IMPACT_SIGNATURE_INVALID,
    TRUST_IMPACT_NO_HELLO_RESPONSE,
    # Enums
    MessageType,
    TreatyStatus,
    TreatyAction,
    ReceiptStatus,
    ProofType,
    CGERRelationship,
    AuthorityLevel as EGIPAuthorityLevel,
    # Identity
    IIdentity,
    SystemIdentity,
    # Envelope
    Envelope as EGIPEnvelope,
    sign_envelope,
    verify_envelope,
    # Payloads
    CGER,
    HelloPayload,
    MessagePayloadContent,
    ReceiptPayload,
    ProofPayload,
    TreatyPayload,
    TreatyTerm,
    AuthorityRequestPayload as EGIPAuthorityRequestPayload,
    DiscoverPayload,
    DiscoverQuery,
    DiscoverResult,
    ChainSegmentProof,
    EventExistenceProof,
    ChainSummaryProof,
    # Version negotiation
    negotiate_version,
    # Treaty
    Treaty,
    new_treaty,
    # Stores & infra
    PeerRecord,
    PeerStore,
    TreatyStore,
    EnvelopeDedup,
    Handler as EGIPHandler,
    # Proof
    ProofGenerator,
    validate_proof,
    verify_chain_segment,
    verify_event_existence,
    # Transport
    ITransport,
    # Errors
    EGIPError,
    SystemNotFoundError as EGIPSystemNotFoundError,
    EnvelopeSignatureInvalidError,
    TreatyViolationError,
    TrustInsufficientError,
    TransportFailureError,
    DuplicateEnvelopeError,
    TreatyNotFoundError,
    VersionIncompatibleError,
)
from .types import (
    Activation,
    ActorID,
    Cadence,
    ConversationID,
    Cursor,
    DomainScope,
    EdgeID,
    EnvelopeID,
    EventID,
    EventType,
    Hash,
    Layer,
    NonEmpty,
    Option,
    Page,
    PublicKey,
    Score,
    Signature,
    SubscriptionPattern,
    SystemURI,
    TreatyID,
    Weight,
)

__version__ = "0.3.0"
