# ===========================================
# MiroFish Backend Dependencies
# ===========================================
# Python 3.11+ required
# Install: pip install -r requirements.txt
# ===========================================

# ============= 核心框架 =============
flask>=3.0.0
flask-cors>=6.0.0

# ============= LLM 相关 =============
# OpenAI SDK（统一使用 OpenAI 格式调用 LLM）
# PINNED 2026-09-01. See test_prHF1_llm_kwargs_contract.py: an open range
# let a major SDK release reach production through a routine rebuild.
openai==1.109.1
# Anthropic SDK（支持 Claude 模型）
# PINNED 2026-09-01 after a total outage. anthropic 1.0.0 (2026-08-20)
# REMOVED the sampling parameters; `messages.create(temperature=...)` became
# a TypeError. `anthropic>=0.30.0` resolved to 1.2.0 on a rebuild and every
# LLM call in the product failed for 22 hours. 0.125.0 is the last release
# that accepts `temperature`. Moving to 1.x is a real migration (drop
# sampling params, adopt output_config/effort) and is separate work.
anthropic==0.125.0

# ============= Zep Cloud =============
zep-cloud==3.13.0

# ============= OASIS 社交媒体模拟 =============
# OASIS 社交模拟框架
camel-oasis==0.2.5
camel-ai==0.2.78
# Pinned exactly, and it must stay pinned.
#
# `mcp` is a TRANSITIVE dependency: camel-ai declares `mcp>=1.3.0` with no
# upper bound and never named a version we control. When mcp 2.0.0 shipped on
# 2026-07-28 it removed `FastMCP` from `mcp.server`, and every image built
# after that date silently acquired a simulation engine that could not start —
# camel.toolkits, camel.agents and camel.societies all raise ImportError, so
# `import oasis` in scripts/run_parallel_simulation.py dies and the subprocess
# exits 1. Eight releases shipped green through this: 630 unit tests, 705
# integration tests and /health all pass without importing camel at all.
#
# Exact rather than `<2` on purpose. The incident is that a Git SHA did not
# determine the artifact; a range leaves that property broken for this package.
# Upgrading is a deliberate decision, made with scripts/oasis_entry_smoke.py.
mcp==1.29.0

# ============= 文件处理 =============
PyMuPDF>=1.24.0
# 编码检测（支持非UTF-8编码的文本文件）
charset-normalizer>=3.0.0
chardet>=5.0.0

# ============= 数据库 =============
# PostgreSQL adapter
psycopg2-binary>=2.9.0

# ============= 工具库 =============
# 环境变量加载
python-dotenv>=1.0.0

# 数据验证
pydantic>=2.0.0

# ============= Export =============
python-pptx>=0.6.0
# Pillow — for generating shareable social cards (OG images)
Pillow>=10.0.0

# ============= 邮件服务 =============
resend>=2.35.0,<3

# ============= Backups =============
# S3-compatible object storage for the uploads-volume backup. Provider-neutral:
# the endpoint is configuration, so R2 / S3 / B2 are a deployment choice.
# Needed because Railway's native volume backups are unavailable on the current
# plan (subscriptionPlanLimit.volumes.maxBackupsCount = 0), leaving the uploads
# volume with no recovery point at all.
boto3>=1.34,<2

# ============= Rate limiting / lockout =============
# v7.2: Redis-backed shared rate-limit + soft account lockout.
# Falls back to in-memory if REDIS_URL is not set (local dev).
redis>=5.0,<6.0
