# SDK identity
SDK_VERSION = "wildedge-python-0.1.0"
PROTOCOL_VERSION = "1.0"

# Env vars
ENV_DSN = "WILDEDGE_DSN"
ENV_DEBUG = "WILDEDGE_DEBUG"
ENV_APP_IDENTITY = "WILDEDGE_APP_IDENTITY"
ENV_APP_VERSION = "WILDEDGE_APP_VERSION"
ENV_FLUSH_TIMEOUT = "WILDEDGE_FLUSH_TIMEOUT"
ENV_INTEGRATIONS = "WILDEDGE_INTEGRATIONS"
ENV_HUBS = "WILDEDGE_HUBS"
ENV_STRICT_INTEGRATIONS = "WILDEDGE_STRICT_INTEGRATIONS"
ENV_PROPAGATE = "WILDEDGE_PROPAGATE"
ENV_PRINT_STARTUP_REPORT = "WILDEDGE_PRINT_STARTUP_REPORT"
ENV_SAMPLING_INTERVAL = "WILDEDGE_SAMPLING_INTERVAL_S"

# Defaults
DEFAULT_SAMPLING_INTERVAL_S = 30.0
DEFAULT_MAX_QUEUE_SIZE = 200
DEFAULT_BATCH_SIZE = 10
DEFAULT_FLUSH_INTERVAL_SEC = 60.0
DEFAULT_HTTP_TIMEOUT = 15.0
DEFAULT_MAX_EVENT_AGE_SEC = 15 * 60
DEFAULT_ENABLE_OFFLINE_PERSISTENCE = True
DEFAULT_ENABLE_DEAD_LETTER_PERSISTENCE = False
DEFAULT_MAX_DEAD_LETTER_BATCHES = 10
DEFAULT_SHUTDOWN_FLUSH_TIMEOUT_SEC = 0.0

# Consumer backoff
BACKOFF_MIN = 1.0
BACKOFF_MAX = 60.0
BACKOFF_MULTIPLIER = 2.0
BACKOFF_JITTER_RATIO = 0.2
IDLE_POLL_INTERVAL = 5.0

# Error message truncation
ERROR_MSG_MAX_LEN = 200

# Device ID persistence
DEVICE_ID_DIR = "wildedge"
DEVICE_ID_FILE = "device_id"

# Autoload (sitecustomize.py)
WILDEDGE_AUTOLOAD = (
    "WILDEDGE_AUTOLOAD"  # set to "1" by `wildedge run` to activate sitecustomize
)

# Runtime validation limits
BATCH_SIZE_MIN = 1
BATCH_SIZE_MAX = 100
FLUSH_INTERVAL_MIN = 1
FLUSH_INTERVAL_MAX = 3600
MAX_QUEUE_SIZE_MIN = 10
MAX_QUEUE_SIZE_MAX = 10000
