"""对话持久化与索引配置。"""

from .paths import DATA_DIR

CONVERSATION_HISTORY_FILE = f"{DATA_DIR}/conversation_history.json"
CONVERSATIONS_DIR = f"{DATA_DIR}/conversations"
CONVERSATION_INDEX_FILE = "index.json"
CONVERSATION_FILE_PREFIX = "conv_"

DEFAULT_CONVERSATIONS_LIMIT = 20
MAX_CONVERSATIONS_LIMIT = 100
CONVERSATION_TITLE_MAX_LENGTH = 100
CONVERSATION_SEARCH_MAX_RESULTS = 50

CONVERSATION_AUTO_CLEANUP_ENABLED = False
CONVERSATION_RETENTION_DAYS = 30
CONVERSATION_MAX_TOTAL = 1000

CONVERSATION_BACKUP_ENABLED = True
CONVERSATION_BACKUP_INTERVAL_HOURS = 24
CONVERSATION_BACKUP_MAX_COUNT = 7

CONVERSATION_MAX_MESSAGE_SIZE = 50000
CONVERSATION_MAX_MESSAGES_PER_CONVERSATION = 10000
CONVERSATION_EXPORT_MAX_SIZE = 10 * 1024 * 1024

CONVERSATION_LAZY_LOADING = True
CONVERSATION_CACHE_SIZE = 50
CONVERSATION_INDEX_UPDATE_BATCH_SIZE = 100

__all__ = [
    "CONVERSATION_HISTORY_FILE",
    "CONVERSATIONS_DIR",
    "CONVERSATION_INDEX_FILE",
    "CONVERSATION_FILE_PREFIX",
    "DEFAULT_CONVERSATIONS_LIMIT",
    "MAX_CONVERSATIONS_LIMIT",
    "CONVERSATION_TITLE_MAX_LENGTH",
    "CONVERSATION_SEARCH_MAX_RESULTS",
    "CONVERSATION_AUTO_CLEANUP_ENABLED",
    "CONVERSATION_RETENTION_DAYS",
    "CONVERSATION_MAX_TOTAL",
    "CONVERSATION_BACKUP_ENABLED",
    "CONVERSATION_BACKUP_INTERVAL_HOURS",
    "CONVERSATION_BACKUP_MAX_COUNT",
    "CONVERSATION_MAX_MESSAGE_SIZE",
    "CONVERSATION_MAX_MESSAGES_PER_CONVERSATION",
    "CONVERSATION_EXPORT_MAX_SIZE",
    "CONVERSATION_LAZY_LOADING",
    "CONVERSATION_CACHE_SIZE",
    "CONVERSATION_INDEX_UPDATE_BATCH_SIZE",
]
