# =============================================================================
# CrewAI Infrastructure — Environment Configuration Template
# =============================================================================
# Copy this file to .env and fill in your values before running docker compose.
#   cp .env.template .env
# =============================================================================

# =============================================================================
# LITELLM — LLM Proxy Configuration
# =============================================================================
# CrewAI connects to your personal LiteLLM proxy for all LLM calls.
# LiteLLM provides an OpenAI-compatible API endpoint.

# Base URL of the LiteLLM proxy server
# Local dev:  http://localhost:4000/v1
# Docker:     http://litellm:4000/v1 (same Docker network)
# Remote:     https://litellm.yourdomain.com/v1
LITELLM_BASE_URL=http://192.168.1.6:4000/v1

# LiteLLM virtual API key (set in LiteLLM proxy config)
LITELLM_API_KEY=sk-NTtjEn3od62f1MCvNY3p3w

# Default model for all CrewAI agents
# Must use the "openai/" prefix for LiteLLM compatibility
# Examples: openai/gpt-4o, openai/claude-sonnet-4-20250514, openai/gemini-2.5-pro
CREWAI_MODEL=openai/deepseek-v4-flash

# LLM temperature (0.0 = deterministic, 1.0 = creative)

# ── Per-Agent Model Selection ──
# Override individual agent models without rebuilding the container.
# Leave empty to use the default (PM/Dev/QA → CREWAI_MODEL, Architect → openai/deepseek-v4-pro).
# Examples: openai/deepseek-v4-flash, openai/deepseek-v4-pro, openai/gpt-4o, openai/claude-sonnet-4-20250514
PM_MODEL=
ARCHITECT_MODEL=
DEV_MODEL=
QA_MODEL=

# Per-agent temperature overrides (leave empty to use CREWAI_TEMPERATURE).
PM_TEMPERATURE=
ARCHITECT_TEMPERATURE=
DEV_TEMPERATURE=
QA_TEMPERATURE=

CREWAI_TEMPERATURE=0.3

# =============================================================================
# DEEPSEEK — LLM API Provider
# =============================================================================
# Alternative to LiteLLM for AI API. It is OpenAI Compatible and is a thinking model
# Has prompt caching support


DEEPSEEK_BASE_URL=https://api.deepseek.com

DEEPSEEK_API_KEY=sk-ea580c92fbc04318ab1d31f2f01c0b04

DEEPSEEK_MODEL=deepseek-v4-pro



# =============================================================================
# GITEA — Self-Hosted Git Server
# =============================================================================
# Your self-hosted Gitea instance at git.mildgrim.com

# Base URL of the Gitea instance
GITEA_BASE_URL=https://git.mildgrim.com

# Gitea username
GITEA_USERNAME=mildgrim

# Gitea personal access token (classic, with repo write permissions)
GITEA_TOKEN=727ac1874909e23a74d2a7c2fb733cb411ccacfa

# Target repository name for generated code (will be created via push-to-create)
GITEA_REPO_NAME=b2b-storefront-medusajs

# Git author name for commits
GIT_AUTHOR_NAME=CrewAI Developer

# Git author email for commits
GIT_AUTHOR_EMAIL=dev@crewai.local

# =============================================================================
# MATRIX — Chat Interface
# =============================================================================
# Matrix bot account credentials. Create a dedicated bot account on your
# homeserver (e.g., @crewai-bot:yourdomain.com).

# Matrix homeserver URL (required for matrix-nio client)
MATRIX_HOMESERVER=https://matrix.mildgrim.com

# Matrix bot account username (full Matrix ID, without @ prefix)
MATRIX_USERNAME=project-manager

# Matrix bot account password
MATRIX_PASSWORD=PM!winner67

# Matrix Personal Access Token for bot account
MATRIX_PAT=syt_cHJvamVjdC1tYW5hZ2Vy_EutbUEwMqhVOtLaHjWSk_0Z2MuF

# Room ID where the bot listens and responds
# Find this in Element/Riot: Room Settings > Advanced > Internal room ID
# Format: !abc123:yourdomain.com
MATRIX_ROOM_ID=!qpwjzyXbftDNoFxdAy:mildgrim.com

# Command prefix for interacting with the bot (default: !)
MATRIX_COMMAND_PREFIX=!

# =============================================================================
# CREWAI API — Internal FastAPI Endpoint
# =============================================================================
# The Matrix bridge sends tasks to the CrewAI engine via REST API.
# In Docker Compose, this is the internal service name.

# URL of the CrewAI FastAPI server (used by Matrix bridge container)
# Docker internal: http://crewai-engine:8000
# Local dev:      http://localhost:8000
CREWAI_API_URL=http://192.168.1.6:8000

# Port for the CrewAI FastAPI server (host port)
CREWAI_API_PORT=8000

# =============================================================================
# CREWAI — Behavior Configuration
# =============================================================================

# Maximum number of QA revision attempts before escalation
QA_MAX_ATTEMPTS=3

# Base directory for cloned repos and working files inside the container
WORKSPACE_DIR=/workspace

# =============================================================================
# MCP SERVERS — Architect Research Tools
# =============================================================================
# The Architect agent uses MCP servers to research MedusaJS and TypeSense APIs.
# Stdio MCP servers run as subprocesses inside the CrewAI engine container.
# Some MCP servers may require API keys or configuration.

# MedusaJS MCP server config (if it requires auth)
# MEDUSAJS_MCP_API_KEY=your-medusajs-api-key

# TypeSense MCP server config (if it requires auth)
# TYPESENSE_MCP_API_KEY=your-typesense-api-key
# TYPESENSE_MCP_HOST=localhost
# TYPESENSE_MCP_PORT=8108
# TYPESENSE_MCP_PROTOCOL=http

# Alternative: Custom MCP server URL (for HTTP-based MCP)
# ARCHITECT_MCP_HTTP_URL=http://mcp-server:3000/mcp
# ARCHITECT_MCP_HTTP_API_KEY=sk-your-mcp-http-api-key

# =============================================================================
# OPENAI — Legacy SDK Fallback
# =============================================================================
# CrewAI's internal SDK may still need an OpenAI API key for initialization.
# If using LiteLLM exclusively, this can be a dummy value, but must be set.

OPENAI_API_KEY=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

# =============================================================================
# DOCKER — Paths (if overriding defaults)
# =============================================================================

# Host path for the persistent workspace volume
# Default: ./data/workspace
# WORKSPACE_HOST_PATH=./data/workspace

# Host path for CrewAI engine logs
# Default: ./data/logs
# LOG_HOST_PATH=./data/logs

# =============================================================================
# DEVELOPMENT — Local Overrides (optional)
# =============================================================================

# Set to "true" to enable verbose CrewAI logging
# CREWAI_VERBOSE=true

# Set to "true" to skip git push (for local testing only)
# GIT_SKIP_PUSH=false

# Path to SSH key for local git operations (optional, not used in Docker)
# GIT_SSH_KEY_PATH=~/.ssh/id_ed25519
