# Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: Apache-2.0
"""
OpenViking - An Agent-native context database

Data in, Context out.
"""

try:
    from ._version import version as __version__
except ImportError:
    try:
        from importlib.metadata import version

        __version__ = version("openviking")
    except ImportError:
        __version__ = "0.0.0+unknown"

try:
    from openviking.pyagfs import AGFSClient
except ImportError:
    raise ImportError(
        "pyagfs not found. Please install: pip install -e third_party/agfs/agfs-sdk/python"
    )


def __getattr__(name: str):
    if name == "AsyncOpenViking":
        from openviking.async_client import AsyncOpenViking

        return AsyncOpenViking
    if name == "SyncOpenViking":
        from openviking.sync_client import SyncOpenViking

        return SyncOpenViking
    if name == "OpenViking":
        from openviking.sync_client import SyncOpenViking

        return SyncOpenViking
    if name == "Session":
        from openviking.session import Session

        return Session
    if name == "AsyncHTTPClient":
        from openviking_cli.client.http import AsyncHTTPClient

        return AsyncHTTPClient
    if name == "SyncHTTPClient":
        from openviking_cli.client.sync_http import SyncHTTPClient

        return SyncHTTPClient
    if name == "UserIdentifier":
        from openviking_cli.session.user_id import UserIdentifier

        return UserIdentifier
    raise AttributeError(name)


__all__ = [
    "OpenViking",
    "SyncOpenViking",
    "AsyncOpenViking",
    "SyncHTTPClient",
    "AsyncHTTPClient",
    "Session",
    "UserIdentifier",
]
