{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "$schema": {
      "type": "string"
    },
    "quiet_mode": {
      "default": false,
      "type": "boolean",
      "description": "Suppress most toast notifications (rate limit, account switching). Recovery toasts always shown."
    },
    "toast_scope": {
      "default": "root_only",
      "type": "string",
      "enum": [
        "root_only",
        "all"
      ],
      "description": "Controls which sessions show toast notifications. 'root_only' (default) shows in root session only, 'all' shows in all sessions."
    },
    "debug": {
      "default": false,
      "type": "boolean",
      "description": "Enable debug logging to file."
    },
    "debug_tui": {
      "default": false,
      "type": "boolean"
    },
    "log_dir": {
      "type": "string",
      "description": "Custom directory for debug logs."
    },
    "keep_thinking": {
      "default": false,
      "type": "boolean",
      "description": "Preserve thinking blocks for Claude models using signature caching. May cause signature errors."
    },
    "session_recovery": {
      "default": true,
      "type": "boolean",
      "description": "Enable automatic session recovery from tool_result_missing errors."
    },
    "auto_resume": {
      "default": false,
      "type": "boolean",
      "description": "Automatically send resume prompt after successful recovery."
    },
    "resume_text": {
      "default": "continue",
      "type": "string",
      "description": "Custom text to send when auto-resuming after recovery."
    },
    "signature_cache": {
      "type": "object",
      "properties": {
        "enabled": {
          "default": true,
          "type": "boolean",
          "description": "Enable disk caching of thinking block signatures."
        },
        "memory_ttl_seconds": {
          "default": 3600,
          "type": "number",
          "minimum": 60,
          "maximum": 86400,
          "description": "In-memory TTL in seconds."
        },
        "disk_ttl_seconds": {
          "default": 172800,
          "type": "number",
          "minimum": 3600,
          "maximum": 604800,
          "description": "Disk TTL in seconds."
        },
        "write_interval_seconds": {
          "default": 60,
          "type": "number",
          "minimum": 10,
          "maximum": 600,
          "description": "Background write interval in seconds."
        }
      },
      "required": [
        "enabled",
        "memory_ttl_seconds",
        "disk_ttl_seconds",
        "write_interval_seconds"
      ],
      "additionalProperties": false,
      "description": "Signature cache configuration for persisting thinking block signatures. Only used when keep_thinking is enabled."
    },
    "empty_response_max_attempts": {
      "default": 4,
      "type": "number",
      "minimum": 1,
      "maximum": 10,
      "description": "Maximum retry attempts when Antigravity returns an empty response (no candidates)."
    },
    "empty_response_retry_delay_ms": {
      "default": 2000,
      "type": "number",
      "minimum": 500,
      "maximum": 10000,
      "description": "Delay in milliseconds between empty response retries."
    },
    "tool_id_recovery": {
      "default": true,
      "type": "boolean",
      "description": "Enable tool ID orphan recovery. Matches mismatched tool responses by function name or creates placeholders."
    },
    "claude_tool_hardening": {
      "default": true,
      "type": "boolean",
      "description": "Enable tool hallucination prevention for Claude models. Injects parameter signatures and strict usage rules."
    },
    "claude_prompt_auto_caching": {
      "default": false,
      "type": "boolean",
      "description": "Enable Claude prompt auto-caching by adding top-level cache_control when absent."
    },
    "proactive_token_refresh": {
      "default": true,
      "type": "boolean",
      "description": "Enable proactive background token refresh before expiry, ensuring requests never block."
    },
    "proactive_refresh_buffer_seconds": {
      "default": 1800,
      "type": "number",
      "minimum": 60,
      "maximum": 7200,
      "description": "Seconds before token expiry to trigger proactive refresh."
    },
    "proactive_refresh_check_interval_seconds": {
      "default": 300,
      "type": "number",
      "minimum": 30,
      "maximum": 1800,
      "description": "Interval between proactive refresh checks in seconds."
    },
    "max_rate_limit_wait_seconds": {
      "default": 300,
      "type": "number",
      "minimum": 0,
      "maximum": 3600
    },
    "quota_fallback": {
      "default": false,
      "type": "boolean",
      "description": "Deprecated: accepted for backward compatibility but ignored at runtime. Gemini fallback between Antigravity and Gemini CLI is always enabled."
    },
    "cli_first": {
      "default": false,
      "type": "boolean",
      "description": "Prefer gemini-cli routing before Antigravity for Gemini models. When false (default), Antigravity is tried first and gemini-cli is fallback."
    },
    "account_selection_strategy": {
      "default": "hybrid",
      "type": "string",
      "enum": [
        "sticky",
        "round-robin",
        "hybrid"
      ]
    },
    "pid_offset_enabled": {
      "default": false,
      "type": "boolean"
    },
    "switch_on_first_rate_limit": {
      "default": true,
      "type": "boolean"
    },
    "scheduling_mode": {
      "default": "cache_first",
      "type": "string",
      "enum": [
        "cache_first",
        "balance",
        "performance_first"
      ],
      "description": "Rate limit scheduling strategy. 'cache_first' (default) waits for cooldowns, 'balance' distributes across accounts, 'performance_first' picks fastest available."
    },
    "max_cache_first_wait_seconds": {
      "default": 60,
      "type": "number",
      "minimum": 5,
      "maximum": 300,
      "description": "Maximum seconds to wait for a rate-limited account in cache_first mode before switching."
    },
    "failure_ttl_seconds": {
      "default": 3600,
      "type": "number",
      "minimum": 60,
      "maximum": 7200,
      "description": "Time in seconds before a failed account is eligible for retry."
    },
    "default_retry_after_seconds": {
      "default": 60,
      "type": "number",
      "minimum": 1,
      "maximum": 300
    },
    "max_backoff_seconds": {
      "default": 60,
      "type": "number",
      "minimum": 5,
      "maximum": 300
    },
    "request_jitter_max_ms": {
      "default": 0,
      "type": "number",
      "minimum": 0,
      "maximum": 5000,
      "description": "Maximum random jitter in milliseconds added to outgoing requests to avoid thundering herd."
    },
    "soft_quota_threshold_percent": {
      "default": 90,
      "type": "number",
      "minimum": 1,
      "maximum": 100,
      "description": "Percentage of quota usage that triggers soft quota warnings and preemptive account switching."
    },
    "quota_refresh_interval_minutes": {
      "default": 15,
      "type": "number",
      "minimum": 0,
      "maximum": 60,
      "description": "Interval in minutes between quota usage checks. Set to 0 to disable periodic checks."
    },
    "soft_quota_cache_ttl_minutes": {
      "default": "auto",
      "anyOf": [
        {
          "type": "string",
          "const": "auto"
        },
        {
          "type": "number",
          "minimum": 1,
          "maximum": 120
        }
      ],
      "description": "TTL for cached soft quota data. 'auto' (default) calculates from refresh interval, or set a fixed number of minutes."
    },
    "health_score": {
      "type": "object",
      "properties": {
        "initial": {
          "default": 70,
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "success_reward": {
          "default": 1,
          "type": "number",
          "minimum": 0,
          "maximum": 10
        },
        "rate_limit_penalty": {
          "default": -10,
          "type": "number",
          "minimum": -50,
          "maximum": 0
        },
        "failure_penalty": {
          "default": -20,
          "type": "number",
          "minimum": -100,
          "maximum": 0
        },
        "recovery_rate_per_hour": {
          "default": 2,
          "type": "number",
          "minimum": 0,
          "maximum": 20
        },
        "min_usable": {
          "default": 50,
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "max_score": {
          "default": 100,
          "type": "number",
          "minimum": 50,
          "maximum": 100
        }
      },
      "required": [
        "initial",
        "success_reward",
        "rate_limit_penalty",
        "failure_penalty",
        "recovery_rate_per_hour",
        "min_usable",
        "max_score"
      ],
      "additionalProperties": false
    },
    "token_bucket": {
      "type": "object",
      "properties": {
        "max_tokens": {
          "default": 50,
          "type": "number",
          "minimum": 1,
          "maximum": 1000
        },
        "regeneration_rate_per_minute": {
          "default": 6,
          "type": "number",
          "minimum": 0.1,
          "maximum": 60
        },
        "initial_tokens": {
          "default": 50,
          "type": "number",
          "minimum": 1,
          "maximum": 1000
        }
      },
      "required": [
        "max_tokens",
        "regeneration_rate_per_minute",
        "initial_tokens"
      ],
      "additionalProperties": false
    },
    "auto_update": {
      "default": true,
      "type": "boolean",
      "description": "Enable automatic plugin updates."
    }
  },
  "additionalProperties": false
}
