# {{project_name}} — environment variables (template)
# Copy to .env and fill in. .env is gitignored.

# ── LeafMesh license (required for production) ─────────────────
LEAFMESH_LICENSE_KEY=

# ── LLM provider (pick one or more) ────────────────────────────
OPENAI_API_KEY=
ANTHROPIC_API_KEY=

# ── Redis ──────────────────────────────────────────────────────
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=

# ── ERP integration ────────────────────────────────────────────
# Which ERP this deployment posts to:
#   netsuite | sap | quickbooks | xero | dynamics
# Consumed by agency/_shared/erp_poster.py (dispatch_erp) — tags every
# posted ledger row with the erp_type.
ERP_TYPE=netsuite
# Production credentials per ERP — see DAY_0_SETUP.md

# Dev-mode ERP ledger path (agency/_shared/erp_poster.py). The dev
# "ERP" is a local SQLite ledger; override to relocate it. In
# production this is irrelevant — you swap ERPDispatcher.post() for
# your real ERP API. Optional.
FINANCE_OPS_ERP_LEDGER=./data/erp_postings.db

# Dev-mode SEEDED source store (agency/_shared/store.py) — ships
# realistic invoices + matching POs (with goods receipts) + a vendor
# master + a GL chart + a posted ledger so the FULL invoice chain runs
# end-to-end with no connectors set. Override to relocate. In production
# this is irrelevant — the read functions hit your ERP / vendor master.
# Optional.
FINANCE_OPS_STORE_DIR=./data

# Default cost center applied by agency/gl_coding_agent.py when the LLM
# returns no cost_center AND the chart_of_accounts knowledge group is
# unseeded. Optional — tune to your default OPEX center.
GL_DEFAULT_COST_CENTER=CC-OPEX

# ── Enterprise system connectors (MCP) ─────────────────────────
# MCP server in front of your ERP — powers the month-end close sweep
# (close_cycle_orchestrator_agent). Enable its cron in
# configs/config.yaml after wiring.
ERP_MCP_URL=
ERP_MCP_TOKEN=
# MCP server in front of your treasury / payment-run system
# (Kyriba / SAP TRM / NetSuite payment runs / Bill.com) — powers
# payment_scheduler_agent.
TREASURY_MCP_URL=
TREASURY_MCP_TOKEN=

# ── Approval matrix ────────────────────────────────────────────
# The dollar-threshold matrix lives as explicit conditions on
# gl_coding_agent's outbound wires in configs/config.yaml:
#   AP clerk up to $5K · Controller up to $50K · CFO above ·
#   dual sign-off above $500K · GL-confidence floor 0.7
# Tune by editing those wire conditions — they ARE the policy.

# ── Escalation channels ────────────────────────────────────────
# PAGER_WEBHOOK + SLACK_FIN_OPS_CHANNEL are consumed LIVE by the
# manager.escalation targets in configs/config.yaml (PagerDuty webhook
# + Slack escalation message). Set them and escalations fire.
PAGER_WEBHOOK=
SLACK_FIN_OPS_CHANNEL=
# SLACK_BOT_TOKEN + SLACK_SIGNING_SECRET are referenced ONLY by the
# commented-out `channels: slack:` block on the human gates
# (ap_clerk / controller / cfo). They do nothing until you UNCOMMENT
# that block in configs/config.yaml to swap the HITL inbox from the
# Hosted Studio default to Slack. Not plug-and-play from env alone.
SLACK_BOT_TOKEN=
SLACK_SIGNING_SECRET=

# ── Observability (auto-enables with LEAFMESH_LICENSE_KEY) ────
LEAFMESH_ENV_TOKEN=development
