"""Core runtime primitives."""

from .archive import ArchiveResult, archive_worktree_snapshot
from .car_context import (
    DEFAULT_AGENT_WORKSPACE_CONTEXT_PROFILE,
    DEFAULT_PMA_CONTEXT_PROFILE,
    DEFAULT_REPO_THREAD_CONTEXT_PROFILE,
    DEFAULT_TICKET_FLOW_CONTEXT_PROFILE,
    CarContextBundle,
    CarContextProfile,
    build_car_context_bundle,
    default_managed_thread_context_profile,
    render_injected_car_context,
    render_runtime_compat_agents_md,
)
from .context_awareness import CAR_AWARENESS_BLOCK, format_file_role_addendum
from .lifecycle_events import (
    LifecycleEvent,
    LifecycleEventEmitter,
    LifecycleEventStore,
    LifecycleEventType,
)
from .pma_automation_store import (
    PmaAutomationStore,
    PmaAutomationTimer,
    PmaAutomationWakeup,
    PmaLifecycleSubscription,
)
from .pr_binding_resolver import resolve_binding_for_scm_event
from .pr_bindings import PrBinding, PrBindingStore
from .publish_executor import (
    DEFAULT_PUBLISH_RETRY_DELAYS_SECONDS,
    PublishActionExecutor,
    PublishExecutionError,
    PublishExecutorRegistry,
    PublishOperationProcessor,
    RetryablePublishError,
    TerminalPublishError,
    drain_pending_publish_operations,
)
from .publish_journal import PublishJournalStore, PublishOperation
from .publish_operation_executors import (
    build_enqueue_managed_turn_executor,
    build_notify_chat_executor,
)
from .scm_events import ScmEvent, ScmEventStore
from .scm_reaction_router import route_scm_reactions
from .scm_reaction_state import (
    ScmReactionState,
    ScmReactionStateStore,
    compute_reaction_fingerprint,
    mark_reaction_delivery_failed,
    mark_reaction_emitted,
    mark_reaction_resolved,
    should_emit_reaction,
    stable_reaction_fingerprint,
)
from .scm_reaction_types import (
    ReactionIntent,
    ScmReactionConfig,
    stable_reaction_operation_key,
)
from .sse import SSEEvent, format_sse, parse_sse_lines
from .type_debt_ledger import (
    build_type_debt_ledger,
    ledger_to_dict,
    render_markdown_report,
)

__all__ = [
    "CAR_AWARENESS_BLOCK",
    "ArchiveResult",
    "CarContextBundle",
    "CarContextProfile",
    "DEFAULT_AGENT_WORKSPACE_CONTEXT_PROFILE",
    "DEFAULT_PMA_CONTEXT_PROFILE",
    "DEFAULT_REPO_THREAD_CONTEXT_PROFILE",
    "DEFAULT_TICKET_FLOW_CONTEXT_PROFILE",
    "LifecycleEvent",
    "LifecycleEventEmitter",
    "LifecycleEventStore",
    "LifecycleEventType",
    "PmaAutomationStore",
    "PmaAutomationTimer",
    "PmaAutomationWakeup",
    "PmaLifecycleSubscription",
    "resolve_binding_for_scm_event",
    "PrBinding",
    "PrBindingStore",
    "build_enqueue_managed_turn_executor",
    "build_notify_chat_executor",
    "DEFAULT_PUBLISH_RETRY_DELAYS_SECONDS",
    "PublishActionExecutor",
    "PublishExecutionError",
    "PublishExecutorRegistry",
    "PublishJournalStore",
    "PublishOperation",
    "PublishOperationProcessor",
    "ReactionIntent",
    "RetryablePublishError",
    "ScmEvent",
    "ScmEventStore",
    "ScmReactionState",
    "ScmReactionStateStore",
    "ScmReactionConfig",
    "SSEEvent",
    "TerminalPublishError",
    "archive_worktree_snapshot",
    "build_car_context_bundle",
    "compute_reaction_fingerprint",
    "build_type_debt_ledger",
    "drain_pending_publish_operations",
    "default_managed_thread_context_profile",
    "format_file_role_addendum",
    "format_sse",
    "ledger_to_dict",
    "mark_reaction_delivery_failed",
    "mark_reaction_emitted",
    "mark_reaction_resolved",
    "parse_sse_lines",
    "route_scm_reactions",
    "render_injected_car_context",
    "render_markdown_report",
    "render_runtime_compat_agents_md",
    "should_emit_reaction",
    "stable_reaction_fingerprint",
    "stable_reaction_operation_key",
]
