//! Shared client logic for the doctate dictation system.
//!
//! This crate is filesystem- and network-aware (unlike `doctate-common`,
//! which is DTO-only), but path-agnostic: callers pass concrete paths so
//! the same code works on Linux desktop, Windows desktop, Android, iOS.
//!
//! Modules:
//! - [`case_store`]: per-case marker files, merge-with-server-snapshot logic
//! - [`snapshot_cache`]: last successful `/api/oneliners` response, cached
//!   on disk so the UI has data at cold start
//! - [`server_sync`]: unified background worker — uploads pending
//!   recordings and polls `/api/oneliners` from a single HTTP client
//! - [`upload`]: pending-queue IO primitives (sidecar write/scan)
//! - [`pending_cleanup`]: orphan reaper for the pending-upload directory

pub mod case_store;
pub mod case_update;
pub mod config;
pub mod footer_status;
pub mod pending_cleanup;
pub mod server_sync;
pub mod snapshot_cache;
pub mod startup;
pub mod upload;

pub use case_store::{CaseMarker, CaseStore, CaseStoreError};
pub use case_update::{PutOnelinerError, put_oneliner};
pub use config::{Config, ConfigError, DEFAULT_POLL_INTERVAL_SECONDS};
pub use footer_status::{FooterStatus, pick_footer_status};
pub use pending_cleanup::cleanup_orphan_audio;
pub use server_sync::{ServerSync, SyncConfig, WorkerSnapshot, WorkerState};
pub use snapshot_cache::{CachedSnapshot, SnapshotCache};
pub use startup::{DEFAULT_MARKER_RETENTION, DEFAULT_ORPHAN_AUDIO_RETENTION, run_startup_cleanup};
pub use upload::{
    PendingUpload, UploadEvent, UploadIoError, scan_pending_dir, sidecar_path_for, write_sidecar,
};
