# Example: Orchestrator Configuration - Solo Mode (Single Developer)
#
# This example shows a minimal orchestrator setup for a single developer.
# Features:
# - Filesystem-based storage (no external dependencies)
# - Minimal resource consumption
# - Simplified monitoring (logs only)
# - Development-friendly logging (debug level)
#
# Usage:
#   nickel export --format toml orchestrator-solo.ncl > orchestrator.solo.toml
#   ORCHESTRATOR_CONFIG=orchestrator.solo.toml cargo run --bin orchestrator

{
  # Workspace Configuration
  workspace = {
    name = "dev-workspace",
    path = "/home/developer/provisioning/data/orchestrator",
    enabled = true,
    multi_workspace = false,
  },

  # Server Configuration
  server = {
    host = "127.0.0.1",  # Localhost only for development
    port = 9090,
    workers = 2,          # Minimal workers for development
    keep_alive = 75,
    max_connections = 128,  # Low limit for single developer
  },

  # Storage: Filesystem (no external dependencies)
  storage = {
    backend = "filesystem",
    path = "/home/developer/provisioning/data/orchestrator",
  },

  # Queue/Task Processing
  queue = {
    max_concurrent_tasks = 3,  # Very low for single developer
    retry_attempts = 2,
    retry_delay = 1000,  # ms
    task_timeout = 1800000,  # 30 minutes for development

    deadletter_queue = {
      enabled = true,
      max_messages = 100,
      retention_period = 3600,  # 1 hour
    },

    priority_levels = ["low", "normal"],
    default_priority = "normal",
  },

  # Batch Workflow
  batch = {
    parallel_limit = 2,
    operation_timeout = 600000,  # 10 minutes

    checkpoint = {
      enabled = true,
      interval = 50,  # Checkpoint frequently for development
      auto_cleanup = true,
      max_checkpoints = 5,
    },

    rollback = {
      strategy = "automatic",
      retain_logs = true,
    },
  },

  # Monitoring: Basic (development-friendly)
  monitoring = {
    enabled = true,

    metrics = {
      enabled = false,  # Disabled for simplicity
      interval = 30,
      export_format = "prometheus",
    },

    health_check = {
      enabled = true,
      interval = 60,  # Less frequent for development
      timeout = 10,
    },

    resources = {
      track_cpu = true,
      track_memory = true,
      track_disk = false,
      alert_threshold_cpu = 80,
      alert_threshold_memory = 70,
    },

    profiling = {
      enabled = false,
      sample_rate = 0.0,
    },
  },

  # Logging: Debug level for development
  logging = {
    level = "debug",  # Verbose logging for development
    format = "text",  # Human-readable format (not JSON)

    outputs = [
      {
        destination = "stdout",
        level = "debug",
      },
      {
        destination = "file",
        path = "/home/developer/.provisioning/logs/orchestrator.log",
        level = "trace",
        rotation = {
          max_size = "10MB",
          max_backups = 3,
          max_age = 7,  # days
        },
      },
    ],

    include_fields = [
      "timestamp",
      "level",
      "message",
      "task_id",
      "file",
      "line",
    ],
  },

  # Security: Relaxed for development
  security = {
    auth = {
      enabled = false,  # No auth required for solo development
      method = "jwt",
    },

    cors = {
      enabled = true,
      allowed_origins = ["*"],  # Allow any origin in development
      allowed_methods = ["*"],
      allowed_headers = ["*"],
    },

    tls = {
      enabled = false,  # No TLS for localhost
    },

    rate_limit = {
      enabled = false,  # No rate limiting in development
    },
  },

  # Extensions: Disabled for simplicity
  extensions = {
    auto_load = false,
  },

  # Database: Not used in filesystem mode
  database = {
    pool = {
      min_size = 1,
      max_size = 5,
      connection_timeout = 30,
      idle_timeout = 300,
      max_lifetime = 1800,
    },
  },

  # Features: Development-focused
  features = {
    enable_audit_logging = false,
    enable_task_history = true,
    enable_performance_tracking = false,
    enable_experimental_features = true,  # Test new features in solo mode
  },
}
