"""
Sync Module - Orchestration of synchronization between markdown and issue tracker.
"""

from .attachments import (
    Attachment,
    AttachmentExtractor,
    AttachmentStatus,
    AttachmentStore,
    AttachmentSyncConfig,
    AttachmentSyncDirection,
    AttachmentSyncer,
    AttachmentSyncResult,
    extract_attachments_from_markdown,
    sync_attachments,
)
from .audit import AuditEntry, AuditTrail, AuditTrailRecorder, create_audit_trail
from .backup import (
    Backup,
    BackupManager,
    IssueSnapshot,
    RestoreOperation,
    RestoreResult,
    create_pre_sync_backup,
    restore_from_backup,
)
from .bidirectional import (
    BidirectionalSyncOrchestrator,
    BidirectionalSyncResult,
)
from .conflict import (
    Conflict,
    ConflictDetector,
    ConflictReport,
    ConflictResolution,
    ConflictResolver,
    ConflictType,
    FieldSnapshot,
    ResolutionStrategy,
    SnapshotStore,
    StorySnapshot,
    SyncSnapshot,
    create_snapshot_from_sync,
)
from .delta import (
    ChangeDirection,
    DeltaSyncResult,
    DeltaTracker,
    FieldChange,
    StoryDelta,
    SyncableField,
    create_delta_tracker,
)
from .dependencies import (
    Dependency,
    DependencyExtractor,
    DependencyGraph,
    DependencySyncConfig,
    DependencySyncer,
    DependencySyncResult,
    DependencyType,
    build_dependency_graph,
    extract_dependencies,
)
from .diff import (
    DiffCalculator,
    DiffFormatter,
    DiffResult,
    FieldDiff,
    IssueDiff,
    compare_backup_to_current,
)
from .epic_hierarchy import (
    EpicHierarchy,
    EpicLevel,
    EpicNode,
    HierarchyExtractor,
    HierarchySyncConfig,
    HierarchySyncer,
    HierarchySyncResult,
    build_hierarchy_from_epics,
    extract_epic_hierarchy,
)
from .field_mapping import (
    FieldDefinition,
    FieldDirection,
    FieldMapper,
    FieldMappingLoader,
    FieldType,
    FieldValueMapping,
    TrackerFieldMappingConfig,
    create_default_jira_mapping,
    create_field_mapper_from_config,
)
from .idempotency import (
    ContentHasher,
    IdempotencyCheck,
    IdempotencyGuard,
    IdempotencyLog,
    IdempotencyResult,
    IdempotencyStatus,
    check_idempotency,
    is_content_unchanged,
)
from .incremental import (
    ChangeDetectionResult,
    ChangeTracker,
    IncrementalSyncStats,
    StoryFingerprint,
    compute_story_hash,
    stories_differ,
)
from .links import (
    LinkChange,
    LinkSyncOrchestrator,
    LinkSyncResult,
)
from .merge import (
    MergeAttempt,
    MergeConfig,
    MergeResult,
    MergeStrategy,
    SmartMergeResolver,
    ThreeWayMerger,
    resolve_conflict_with_merge,
)
from .multi_epic import (
    EpicSyncResult,
    MultiEpicSyncOrchestrator,
    MultiEpicSyncResult,
)
from .multi_tracker import (
    MultiTrackerSyncOrchestrator,
    MultiTrackerSyncResult,
    SyncStrategy,
    TrackerSyncStatus,
    TrackerTarget,
    TrackerType,
    create_multi_tracker_orchestrator,
)
from .orchestrator import FailedOperation, SyncOrchestrator, SyncResult
from .parallel import (
    EpicProgress,
    ParallelStrategy,
    ParallelSyncConfig,
    ParallelSyncOrchestrator,
    ParallelSyncResult,
    create_parallel_orchestrator,
)
from .parallel_files import (
    FileProgress,
    FileSyncResult,
    ParallelFileProcessor,
    ParallelFilesConfig,
    ParallelFilesResult,
    create_parallel_file_processor,
    process_files_parallel,
)
from .progress import (
    ProgressCallback,
    ProgressReporter,
    ProgressState,
    create_progress_reporter,
)
from .progress import (
    SyncPhase as ProgressSyncPhase,
)
from .reverse_sync import (
    ChangeDetail,
    PullChanges,
    PullResult,
    ReverseSyncOrchestrator,
)
from .source_updater import (
    EpicTrackerInfo,
    SourceFileUpdater,
    SourceUpdateResult,
    SubtaskTrackerInfo,
    SyncStatus,
    TrackerInfo,
    compute_content_hash,
    compute_story_content_hash,
    detect_sync_conflicts,
)
from .sprint_sync import (
    Sprint,
    SprintAssignment,
    SprintExtractor,
    SprintState,
    SprintSyncConfig,
    SprintSyncer,
    SprintSyncResult,
    extract_sprint,
    parse_sprint_name,
)
from .state import OperationRecord, StateStore, SyncPhase, SyncState
from .time_tracking import (
    TimeTrackingExtractor,
    TimeTrackingInfo,
    TimeTrackingSyncConfig,
    TimeTrackingSyncer,
    TimeTrackingSyncResult,
    TimeUnit,
    TimeValue,
    WorkLogEntry,
    extract_time_tracking,
    format_time_for_markdown,
    parse_time_estimate,
)
from .transaction import OperationType as TransactionOperationType
from .transaction import (
    RollbackResult,
    TransactionalSync,
    TransactionManager,
    TransactionResult,
    TransactionState,
    create_transactional_sync,
)
from .workflow_rules import (
    RuleAction,
    RuleActionSpec,
    RuleCondition,
    RuleExecutionResult,
    RuleType,
    WorkflowConfig,
    WorkflowEngine,
    WorkflowExecutionResult,
    WorkflowRule,
    create_default_rules,
    evaluate_epic_rules,
    evaluate_story_rules,
)
from .worklog_sync import (
    WorklogChange,
    WorklogExtractor,
    WorklogSyncConfig,
    WorklogSyncer,
    WorklogSyncResult,
    extract_worklogs,
    format_worklogs_as_markdown,
)


PARALLEL_AVAILABLE = True

__all__ = [
    "PARALLEL_AVAILABLE",
    "Attachment",
    "AttachmentExtractor",
    "AttachmentStatus",
    "AttachmentStore",
    "AttachmentSyncConfig",
    "AttachmentSyncDirection",
    "AttachmentSyncResult",
    "AttachmentSyncer",
    "AuditEntry",
    "AuditTrail",
    "AuditTrailRecorder",
    "Backup",
    "BackupManager",
    "BidirectionalSyncOrchestrator",
    "BidirectionalSyncResult",
    "ChangeDetail",
    "ChangeDetectionResult",
    "ChangeDirection",
    "ChangeTracker",
    "Conflict",
    "ConflictDetector",
    "ConflictReport",
    "ConflictResolution",
    "ConflictResolver",
    "ConflictType",
    "ContentHasher",
    "DeltaSyncResult",
    "DeltaTracker",
    "Dependency",
    "DependencyExtractor",
    "DependencyGraph",
    "DependencySyncConfig",
    "DependencySyncResult",
    "DependencySyncer",
    "DependencyType",
    "DiffCalculator",
    "DiffFormatter",
    "DiffResult",
    "EpicHierarchy",
    "EpicLevel",
    "EpicNode",
    "EpicProgress",
    "EpicSyncResult",
    "EpicTrackerInfo",
    "FailedOperation",
    "FieldChange",
    "FieldDefinition",
    "FieldDiff",
    "FieldDirection",
    "FieldMapper",
    "FieldMappingLoader",
    "FieldSnapshot",
    "FieldType",
    "FieldValueMapping",
    "FileProgress",
    "FileSyncResult",
    "HierarchyExtractor",
    "HierarchySyncConfig",
    "HierarchySyncResult",
    "HierarchySyncer",
    "IdempotencyCheck",
    "IdempotencyGuard",
    "IdempotencyLog",
    "IdempotencyResult",
    "IdempotencyStatus",
    "IncrementalSyncStats",
    "IssueDiff",
    "IssueSnapshot",
    "LinkChange",
    "LinkSyncOrchestrator",
    "LinkSyncResult",
    "MergeAttempt",
    "MergeConfig",
    "MergeResult",
    "MergeStrategy",
    "MultiEpicSyncOrchestrator",
    "MultiEpicSyncResult",
    "MultiTrackerSyncOrchestrator",
    "MultiTrackerSyncResult",
    "OperationRecord",
    "ParallelFileProcessor",
    "ParallelFilesConfig",
    "ParallelFilesResult",
    "ParallelStrategy",
    "ParallelSyncConfig",
    "ParallelSyncOrchestrator",
    "ParallelSyncResult",
    "ProgressCallback",
    "ProgressReporter",
    "ProgressState",
    "ProgressSyncPhase",
    "PullChanges",
    "PullResult",
    "ResolutionStrategy",
    "RestoreOperation",
    "RestoreResult",
    "ReverseSyncOrchestrator",
    "RollbackResult",
    "RuleAction",
    "RuleActionSpec",
    "RuleCondition",
    "RuleExecutionResult",
    "RuleType",
    "SmartMergeResolver",
    "SnapshotStore",
    "SourceFileUpdater",
    "SourceUpdateResult",
    "Sprint",
    "SprintAssignment",
    "SprintExtractor",
    "SprintState",
    "SprintSyncConfig",
    "SprintSyncResult",
    "SprintSyncer",
    "StateStore",
    "StoryDelta",
    "StoryFingerprint",
    "StorySnapshot",
    "SubtaskTrackerInfo",
    "SyncOrchestrator",
    "SyncPhase",
    "SyncResult",
    "SyncSnapshot",
    "SyncState",
    "SyncStatus",
    "SyncStrategy",
    "SyncableField",
    "ThreeWayMerger",
    "TimeTrackingExtractor",
    "TimeTrackingInfo",
    "TimeTrackingSyncConfig",
    "TimeTrackingSyncResult",
    "TimeTrackingSyncer",
    "TimeUnit",
    "TimeValue",
    "TrackerFieldMappingConfig",
    "TrackerInfo",
    "TrackerSyncStatus",
    "TrackerTarget",
    "TrackerType",
    "TransactionManager",
    "TransactionOperationType",
    "TransactionResult",
    "TransactionState",
    "TransactionalSync",
    "WorkLogEntry",
    "WorkflowConfig",
    "WorkflowEngine",
    "WorkflowExecutionResult",
    "WorkflowRule",
    "WorklogChange",
    "WorklogExtractor",
    "WorklogSyncConfig",
    "WorklogSyncResult",
    "WorklogSyncer",
    "build_dependency_graph",
    "build_hierarchy_from_epics",
    "check_idempotency",
    "compare_backup_to_current",
    "compute_content_hash",
    "compute_story_content_hash",
    "compute_story_hash",
    "create_audit_trail",
    "create_default_jira_mapping",
    "create_default_rules",
    "create_delta_tracker",
    "create_field_mapper_from_config",
    "create_multi_tracker_orchestrator",
    "create_parallel_file_processor",
    "create_parallel_orchestrator",
    "create_pre_sync_backup",
    "create_progress_reporter",
    "create_snapshot_from_sync",
    "create_transactional_sync",
    "detect_sync_conflicts",
    "evaluate_epic_rules",
    "evaluate_story_rules",
    "extract_attachments_from_markdown",
    "extract_dependencies",
    "extract_epic_hierarchy",
    "extract_sprint",
    "extract_time_tracking",
    "extract_worklogs",
    "format_time_for_markdown",
    "format_worklogs_as_markdown",
    "is_content_unchanged",
    "parse_sprint_name",
    "parse_time_estimate",
    "process_files_parallel",
    "resolve_conflict_with_merge",
    "restore_from_backup",
    "stories_differ",
    "sync_attachments",
]
