# Solace AI Connector Example: Slack Gateway Configuration
# You'd need to install the `sam-slack` plugin first with:
# 'pip install "sam-slack @ git+https://github.com/SolaceLabs/solace-agent-mesh-core-plugins#subdirectory=sam-slack"'
# This file demonstrates how to configure the Slack Gateway application.
# It uses the custom SlackGatewayApp class defined here:
# https://github.com/SolaceLabs/solace-agent-mesh-core-plugins/blob/main/sam-slack/src/sam_slack/app.py
#
#
# Required Environment Variables:
# - NAMESPACE: The A2A topic namespace (e.g., "myorg/dev"). 
# - SOLACE_BROKER_URL: URL of the Solace broker (e.g., "ws://localhost:8080").
# - SOLACE_BROKER_USERNAME: Username for the Solace broker.
# - SOLACE_BROKER_PASSWORD: Password for the Solace broker.
# - SOLACE_BROKER_VPN: VPN name for the Solace broker.
# - SLACK_BOT_TOKEN: Your Slack Bot Token (starts with 'xoxb-').
# - SLACK_APP_TOKEN: Your Slack App Token for Socket Mode (starts with 'xapp-').
#
# Optional Environment Variables for RBAC example:
# - ROLE_DEFINITIONS_PATH
# - USER_ASSIGNMENTS_PATH

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

# Shared SAM config
!include ../shared_config.yaml

apps:
  - name: slack_gateway_app # Name for this specific SAC application instance
    app_base_path: . # Assuming running from project root where src/ is located
    app_module: sam_slack.app 

    broker:
      <<: *broker_connection
      # Queue name and subscriptions are automatically generated by SlackGatewayApp

    # App Level Config - Validated by SlackGatewayApp.app_schema
    app_config:
      # --- Required ---
      namespace: ${NAMESPACE} 
      slack_bot_token: ${SLACK_BOT_TOKEN}
      slack_app_token: ${SLACK_APP_TOKEN}

      # --- Artifact Service (Required for late embeds) ---
      # Example using filesystem, ensure path exists and is accessible
      # Scope 'namespace' means artifacts are shared with other components
      # (like ADK Hosts) configured with the same namespace and base_path.
      artifact_service:
        type: "filesystem"
        base_path: "/tmp/samv2"
        artifact_scope: "namespace" # Or "app", or "custom" + artifact_scope_value

      # --- Optional with Defaults ---
      # gateway_id: "my-specific-slack-gw-1" # Auto-generated if omitted
      default_agent_name: "OrchestratorAgent" # Agent to use if no mention specifies one

      # --- Embed Resolution Config ---
      enable_embed_resolution: true
      gateway_artifact_content_limit_bytes: 10000000 # 10MB example
      gateway_recursive_embed_depth: 3

      # --- Slack Behavior ---
      slack_initial_status_message: ":thinking_face: Thinking..." # Set empty "" to disable
      correct_markdown_formatting: true
      slack_email_cache_ttl_seconds: 0 # Set to 0 for immediate testing of email identity

      # --- Optional Feedback Config ---
      # feedback_enabled: true
      # feedback_post_url: "http://your-feedback-service.example.com/feedback"
      # feedback_post_headers:
      #   Authorization: "Bearer your_feedback_token"
      #   Content-Type: "application/json"

      # --- Authorization Service Configuration (Example using default_rbac) ---
      authorization_service:
        type: "default_rbac" # Use the GDK's built-in RBAC service
        # Paths to your role and user assignment YAML files.
        # These can be absolute paths or relative to the directory where SAC is run.
        # Using environment variables for flexibility is recommended.
        role_definitions_path: ${ROLE_DEFINITIONS_PATH, examples/auth/dev-roles.yaml}
        user_assignments_path: ${USER_ASSIGNMENTS_PATH, examples/auth/dev-users.yaml}

          # Optional: Custom Python providers for more dynamic role/scope lookups.
          # If these are not provided, the service relies solely on the YAML files.
          # custom_role_provider_module: "my_company.auth.slack_roles"
          # custom_role_provider_function: "get_user_roles_from_ldap"
          # custom_scope_provider_module: "my_company.auth.slack_scopes"
          # custom_scope_provider_function: "get_scopes_for_role_from_policy_db"
