spring:
  application:
    name: th-hotel-server
  profiles:
    # 未显式指定 profile 时默认使用 dev，避免本地启动误连 test/prod。
    default: dev
  flyway:
    enabled: true
  servlet:
    multipart:
      # multipart 需要高于 Debug EML / 文件转换业务上限，避免超限文件在进入 Controller 前被框架直接 413 拦截。
      max-file-size: ${DOCUMENT_CONVERSION_MULTIPART_MAX_FILE_BYTES:${DEBUG_EML_UPLOAD_MULTIPART_MAX_FILE_BYTES:25165824}}
      max-request-size: ${DOCUMENT_CONVERSION_MULTIPART_MAX_REQUEST_BYTES:${DEBUG_EML_UPLOAD_MULTIPART_MAX_REQUEST_BYTES:${DEBUG_EML_UPLOAD_MAX_REQUEST_BYTES:29360128}}}
  mvc:
    async:
      # Spring MVC async timeout 是应用级全局值；当前主要用于避免 Debug EML SSE 先于 SuperAgent 调试调用关闭。
      request-timeout: ${DEBUG_EML_UPLOAD_SSE_REQUEST_TIMEOUT:${SPRING_MVC_ASYNC_REQUEST_TIMEOUT:1800s}}

mybatis-plus:
  configuration:
    map-underscore-to-camel-case: true
  global-config:
    banner: false

agentbus:
  probe:
    enabled: false
  max-frame-bytes: 1048576
  capture:
    enabled: ${AGENTBUS_CAPTURE_ENABLED:true}
  superagent-dispatch:
    # M007 AgentBus 入库后自动分发 SuperAgent，默认关闭，联调环境显式开启。
    enabled: ${AGENTBUS_SUPERAGENT_DISPATCH_ENABLED:false}
    worker-enabled: ${AGENTBUS_SUPERAGENT_DISPATCH_WORKER_ENABLED:false}
    batch-size: ${AGENTBUS_SUPERAGENT_DISPATCH_BATCH_SIZE:10}
    max-attempts: ${AGENTBUS_SUPERAGENT_DISPATCH_MAX_ATTEMPTS:3}
    lock-ttl: ${AGENTBUS_SUPERAGENT_DISPATCH_LOCK_TTL:5m}
    initial-backoff: ${AGENTBUS_SUPERAGENT_DISPATCH_INITIAL_BACKOFF:30s}
    max-backoff: ${AGENTBUS_SUPERAGENT_DISPATCH_MAX_BACKOFF:15m}
    worker-fixed-delay-ms: ${AGENTBUS_SUPERAGENT_DISPATCH_WORKER_FIXED_DELAY_MS:10000}

superagent:
  task-result:
    clock-skew-seconds: 300
    nonce-ttl-seconds: 600
    max-body-bytes: 1048576

auth:
  session:
    # 登录 session 默认 12 小时；各环境可通过 AUTH_*_SESSION_TTL_MINUTES 覆盖。
    ttl-minutes: ${AUTH_SESSION_TTL_MINUTES:720}

document-conversion:
  # M008 Excel 转 PDF 文件转换能力，默认关闭；启用前必须确认 LibreOffice、字体、OSS 和访问口令。
  enabled: ${DOCUMENT_CONVERSION_ENABLED:false}
  access-key: ${DOCUMENT_CONVERSION_ACCESS_KEY:}
  soffice-path: ${DOCUMENT_CONVERSION_SOFFICE_PATH:soffice}
  temp-dir: ${DOCUMENT_CONVERSION_TEMP_DIR:${java.io.tmpdir}/th-hotel-document-conversion}
  max-file-bytes: ${DOCUMENT_CONVERSION_MAX_FILE_BYTES:20971520}
  timeout-seconds: ${DOCUMENT_CONVERSION_TIMEOUT_SECONDS:60}
  max-concurrent: ${DOCUMENT_CONVERSION_MAX_CONCURRENT:2}
  output-oss-prefix: ${DOCUMENT_CONVERSION_OUTPUT_OSS_PREFIX:document-conversions/excel-to-pdf/}
  worker-enabled: ${DOCUMENT_CONVERSION_WORKER_ENABLED:false}

mcp:
  # SuperAgent MCP 默认关闭；启用时必须通过部署环境配置高熵 Bearer Token。
  enabled: ${MCP_ENABLED:false}
  http-path: ${MCP_HTTP_PATH:/mcp}
  auth-token: ${MCP_AUTH_TOKEN:}
  enable-submit-task-results: ${MCP_ENABLE_SUBMIT_TASK_RESULTS:false}
  max-body-bytes: ${MCP_MAX_BODY_BYTES:10485760}

server:
  port: 8080
