Files
microdao-daarion/services/sofiia-supervisor/app/config.py
Apple 129e4ea1fc feat(platform): add new services, tools, tests and crews modules
New router intelligence modules (26 files): alert_ingest/store, audit_store,
architecture_pressure, backlog_generator/store, cost_analyzer, data_governance,
dependency_scanner, drift_analyzer, incident_* (5 files), llm_enrichment,
platform_priority_digest, provider_budget, release_check_runner, risk_* (6 files),
signature_state_store, sofiia_auto_router, tool_governance

New services:
- sofiia-console: Dockerfile, adapters/, monitor/nodes/ops/voice modules, launchd, react static
- memory-service: integration_endpoints, integrations, voice_endpoints, static UI
- aurora-service: full app suite (analysis, job_store, orchestrator, reporting, schemas, subagents)
- sofiia-supervisor: new supervisor service
- aistalk-bridge-lite: Telegram bridge lite
- calendar-service: CalDAV calendar service with reminders
- mlx-stt-service / mlx-tts-service: Apple Silicon speech services
- binance-bot-monitor: market monitor service
- node-worker: STT/TTS memory providers

New tools (9): agent_email, browser_tool, contract_tool, observability_tool,
oncall_tool, pr_reviewer_tool, repo_tool, safe_code_executor, secure_vault

New crews: agromatrix_crew (10 modules: depth_classifier, doc_facts, doc_focus,
farm_state, light_reply, llm_factory, memory_manager, proactivity, reflection_engine,
session_context, style_adapter, telemetry)

Tests: 85+ test files for all new modules
Made-with: Cursor
2026-03-03 07:14:14 -08:00

50 lines
3.0 KiB
Python

"""
Sofiia Supervisor — Configuration
All settings from environment variables with sane defaults.
"""
from __future__ import annotations
import os
from typing import Optional
class Settings:
# ─── Router / Gateway ────────────────────────────────────────────────────
# URL of the DAARION router service that exposes /v1/tools/execute
GATEWAY_BASE_URL: str = os.getenv("GATEWAY_BASE_URL", "http://router:8000")
SUPERVISOR_API_KEY: str = os.getenv("SUPERVISOR_API_KEY", "")
# ─── State backend ───────────────────────────────────────────────────────
STATE_BACKEND: str = os.getenv("SUPERVISOR_STATE_BACKEND", "redis") # redis | memory
REDIS_URL: str = os.getenv("REDIS_URL", "redis://redis:6379/0")
RUN_TTL_SEC: int = int(os.getenv("RUN_TTL_SEC", "86400")) # 24h
# ─── Supervisor API ──────────────────────────────────────────────────────
SUPERVISOR_HOST: str = os.getenv("SUPERVISOR_HOST", "0.0.0.0")
SUPERVISOR_PORT: int = int(os.getenv("SUPERVISOR_PORT", "8080"))
# Optional API key to protect supervisor HTTP endpoints (independent of gateway RBAC)
SUPERVISOR_INTERNAL_KEY: str = os.getenv("SUPERVISOR_INTERNAL_KEY", "")
# ─── Agent defaults ──────────────────────────────────────────────────────
DEFAULT_AGENT_ID: str = os.getenv("DEFAULT_AGENT_ID", "sofiia")
DEFAULT_WORKSPACE_ID: str = os.getenv("DEFAULT_WORKSPACE_ID", "daarion")
DEFAULT_TIMEZONE: str = os.getenv("DEFAULT_TIMEZONE", "Europe/Kiev")
# ─── Timeouts ────────────────────────────────────────────────────────────
# Per gateway tool call (seconds)
TOOL_CALL_TIMEOUT_SEC: float = float(os.getenv("TOOL_CALL_TIMEOUT_SEC", "60.0"))
# Max retries for retryable errors (2xx vs 5xx)
TOOL_CALL_MAX_RETRIES: int = int(os.getenv("TOOL_CALL_MAX_RETRIES", "2"))
# Polling interval for async jobs (seconds)
JOB_POLL_INTERVAL_SEC: float = float(os.getenv("JOB_POLL_INTERVAL_SEC", "3.0"))
# Max job wait time (seconds) — safety valve
JOB_MAX_WAIT_SEC: float = float(os.getenv("JOB_MAX_WAIT_SEC", "300.0"))
# ─── Incident triage constraints ─────────────────────────────────────────
INCIDENT_MAX_TIME_WINDOW_H: int = int(os.getenv("INCIDENT_MAX_TIME_WINDOW_H", "24"))
INCIDENT_MAX_LOG_LINES: int = int(os.getenv("INCIDENT_MAX_LOG_LINES", "200"))
settings = Settings()