"""
Quber - Advanced document parsing platform.

Two engine-agnostic seams:

- `Parser` abstract base class (`quber.core.parsers.base`) — produces a
  ParseResult, which carries the full DoclingDocument on `.document`.
- `TableExtractor` Protocol (`quber.core.extractors`) — produces a list of
  ExtractedTable Pydantic models from table-only engines like Camelot+LLM.

`quber.core.fusion` composes a Parser with the Set-of-Mark table extractor and
merges their output with `fuse_artifacts`. The CLI exposes it as `quber fuse`.
"""

__version__ = "0.3.0"

# Two import-time initializers, each a named function (no inline side effects):
#   - preload_cuda_runtime_libs: preload CUDA 12 runtime libs so
#     onnxruntime-gpu's CUDAExecutionProvider can resolve them on CUDA-13 hosts.
#     Must run before any docling/onnxruntime import; silent on CPU-only hosts.
#   - init_s3_cache: register the persistent, TTL-swept S3 client as
#     cloudpathlib's default for s3:// URIs. Offline-safe (boto3 resolves creds
#     and network lazily), so it is fine to run at import on any host.
from quber.files.cache import init_s3_cache
from quber.utils.cuda_runtime import preload_cuda_runtime_libs

preload_cuda_runtime_libs()
init_s3_cache()

# No eager re-exports here. Importing the docling-backed parsers or the
# inference processor at package import would pull the heavy GPU/ML stack into
# every `import quber` -- including the CPU-only `table` cloud-job image, which
# imports none of it. Import them from their modules at the point of use, e.g.
# `from quber.core.parsers import parser_for_preset` or
# `from quber.processors import TableInferenceProcessor`.
