# Platform Service Template for Solace Agent Mesh
# Provides agent management, deployments, connectors, and toolsets

log:
  stdout_log_level: INFO
  log_file_level: DEBUG
  log_file: platform_service.log

# Shared SAM config (broker, models, etc.)
!include ../shared_config.yaml

apps:
  - name: platform_service_app
    app_base_path: .
    app_module: solace_agent_mesh.services.platform.app

    broker:
      <<: *broker_connection

    app_config:
      # --- Required ---
      namespace: ${NAMESPACE}
      database_url: "${PLATFORM_DATABASE_URL, sqlite:///platform.db}"

      # --- FastAPI Server Configuration ---
      fastapi_host: ${PLATFORM_API_HOST, localhost}
      fastapi_port: ${PLATFORM_API_PORT, 8001}
      cors_allowed_origins:
        - "http://localhost:3000"
        - "http://127.0.0.1:3000"
        - "http://localhost:8000"

      # --- Message Size Configuration ---
      max_message_size_bytes: ${MAX_MESSAGE_SIZE_BYTES, 10000000}

      # --- OAuth2 Authentication ---
      # Community mode: frontend_use_authorization=false (dev user)
      # Enterprise mode: frontend_use_authorization=true (OAuth validation)
      external_auth_service_url: ${EXTERNAL_AUTH_SERVICE_URL}
      external_auth_provider: ${EXTERNAL_AUTH_PROVIDER, generic}
      frontend_use_authorization: ${FRONTEND_USE_AUTHORIZATION, false}

      # --- Background Task Configuration ---
      # Deployment monitoring (enterprise feature)
      deployment_timeout_minutes: ${DEPLOYMENT_TIMEOUT_MINUTES, 5}
      deployment_check_interval_seconds: ${DEPLOYMENT_CHECK_INTERVAL, 60}

      # Deployer heartbeat monitoring (enterprise feature)
      heartbeat_timeout_seconds: ${HEARTBEAT_TIMEOUT_SECONDS, 90}
