# Solace AI Connector Example: Slack Gateway Configuration
# This file demonstrates how to configure the Slack Gateway using the Generic Gateway Adapter framework.
# It uses the generic App class and points to the Slack adapter implementation.
#
#
# Required Environment Variables:
# - NAMESPACE: The A2A topic namespace (e.g., "myorg/dev").
# - SOLACE_BROKER_URL: URL of the Solace broker (e.g., "ws://localhost:8008").
# - 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: solace_agent_mesh.gateway.generic.app

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

    # App Level Config - Validated by GenericGatewayApp and BaseGatewayApp
    app_config:
      # --- Required ---
      namespace: ${NAMESPACE}

      # --- Generic Adapter Framework Config ---
      gateway_adapter: sam_slack_gateway_adapter.adapter.SlackAdapter

      # --- Slack Adapter-Specific Config ---
      adapter_config:
        slack_bot_token: ${SLACK_BOT_TOKEN}
        slack_app_token: ${SLACK_APP_TOKEN}
        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
        feedback_enabled: true

      # --- 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 (from BaseGatewayApp) ---
      # 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

      # --- System Purpose (from BaseGatewayApp) ---
      system_purpose: >
            The system is an AI Chatbot with agentic capabilities.
            It will use the agents available to provide information,
            reasoning and general assistance for the users in this system.
            **Always return useful artifacts and files that you create to the user.**            
            Provide a status update before each tool call.
            Your external name is Agent Mesh.

      response_format: >
            Responses should be clear, concise, and professionally toned.
            Format responses to the user in Markdown using appropriate formatting.
            Note that the user is not able to access the internal artifacts of the system. You
            must return them, so if you create any files or artifacts, provide them to the user 
            via the artifact_return embed.

      # --- Optional Feedback Config ---
      # The feedback_publishing block is used by the GenericGatewayComponent to publish feedback events.
      # The adapter_config.feedback_enabled flag controls if the UI shows the buttons.
      feedback_publishing:
        enabled: true
