# ─────────────────────────────────────────────────────────────────────────
# WHAT BELONGS IN THIS FILE — and what does NOT
#
# This file is for the DEPLOYMENT'S OWN identity and its model keys. That is
# all. Provider credentials do NOT live here.
#
#   HERE, in .env
#     LEAFMESH_LICENSE_KEY, LEAFMESH_ENV_TOKEN
#     the ports, REDIS_* / Postgres  (the store the vault itself lives in)
#     your model provider key(s): OPENAI_API_KEY / ANTHROPIC_API_KEY /
#       GOOGLE_API_KEY …  (these are read from the environment as the mesh
#       starts, so they must be here — the vault is read too late for them)
#
#   NOT HERE — in the VAULT, added on Studio's Infrastructure page
#     every channel credential  (Slack bot_token / signing_secret / app_token,
#       Teams, Discord, Cliq, WhatsApp, Email)
#     every connector credential (MCP, Zapier, Composio, n8n, custom)
#     Config then names it:  connection: "slack-workspace"
#
# Why it matters: since 2.4.180 the mesh REFUSES TO BOOT if it finds a
# provider credential written into config — and `${ENV_VAR}` does not help,
# because substitution happens before the check runs, so the check sees the
# token itself. `connection:` is the only path that works.
#
# Note: a value is EMPTY here, never a comment. `KEY=   # explanation` is read
# by python-dotenv as the COMMENT being the value.
# ─────────────────────────────────────────────────────────────────────────

# {{project_name}} — environment (template — copy to .env)
LEAFMESH_LICENSE_KEY=

OPENAI_API_KEY=
ANTHROPIC_API_KEY=

REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=

# Escalation channels
# consumed: manager.escalation webhook target in config.yaml
PAGER_WEBHOOK=
# consumed: manager.escalation slack channel_id in config.yaml
SLACK_CS_CHANNEL=
# The Slack escalation target above posts a channel notification. The
# channel_id alone does NOT authenticate — to actually post you must
# wire a bot token into the escalation channel (or a top-level
# `channels:` slack adapter, which reads bot_token). These two are NOT
# auto-consumed by the escalation block as written; wire them in the
# connector/channel config before relying on Slack delivery.
# wire into a channels: slack adapter — not auto-read by escalation
SLACK_BOT_TOKEN=
# only needed if you add an inbound Slack adapter; wire in code/config
SLACK_SIGNING_SECRET=

# n8n connector webhooks (connector-YAML agents — fill in, then
# uncomment the matching wake_up crons in configs/config.yaml)
# Pendo / Amplitude / Segment workflow
N8N_CS_OPERATIONS_WEBHOOK_URL=
# Salesforce / Gainsight workflow
N8N_CUSTOMER_ONBOARDING_WEBHOOK_URL=
# Klue / Crayon workflow
N8N_COMPETITOR_INTEL_WEBHOOK_URL=

# CRM / CS-platform MCP (account_intel_agent's commented mcp: block).
# Set the URL, then UNCOMMENT the mcp block in configs/config.yaml (an
# empty-url http mcp is rejected at load). Until then the agency/tools.py
# dev-store tools serve day-0 and announce available:false with no source.
# your CRM / CS-platform MCP endpoint (Salesforce / Gainsight)
CRM_MCP_URL=
# bearer token for the CRM MCP
CRM_MCP_TOKEN=

LEAFMESH_ENV_TOKEN=development

# Tuning — save_play_agent's @chain caps save-play touches per account;
# past the cap the play escalates to a senior CSM (bounded loop, Rule 3).
CS_SAVE_PLAY_MAX_TOUCHES=3   # consumed: agency/save_play_agent.py

# play_runner_agent — the EXECUTOR. After a human approves a play it RUNS
# it: SENDS the save-message via comms, or BOOKS the QBR via calendar.
# Both connectors are INERT until set — with neither set, play_runner
# records the sent message / booked meeting in the dev store so the play
# still produces a real artifact day-0.
# consumed: agency/play_runner_agent.py — comms platform send webhook (Slack/email/CPaaS)
CS_COMMS_WEBHOOK_URL=
# consumed: agency/play_runner_agent.py — calendar booking webhook (Google Calendar / Cal.com)
CALENDAR_WEBHOOK_URL=
CS_MAX_PLAYS_PER_DAY=3       # consumed: agency/play_runner_agent.py — per-account frequency cap (fail-closed)

# account_sweep_agent — the base-wide sweep fanned out over instances: 3.
CS_SWEEP_BATCH=5             # consumed: agency/account_sweep_agent.py — per-instance atomic claim size
CS_SWEEP_AT_RISK_BELOW=60    # consumed: agency/account_sweep_agent.py — health baseline below this flags an account
