{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Dicto app configuration",
  "description": "Managed desktop config.yaml. Optional settings inherit release defaults; invalid files stop startup.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "config_version"
  ],
  "properties": {
    "config_version": {
      "type": "integer",
      "const": 1
    },
    "server_config": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "api_url": {
          "type": "string",
          "minLength": 1,
          "pattern": "^https?://[^\\s?#]*[^/\\s?#]$",
          "format": "uri",
          "description": "Public Dicto API base URL, without a trailing slash, query or fragment."
        }
      },
      "required": [
        "api_url"
      ]
    },
    "onboarding": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "show_public_instance": {
          "type": "boolean"
        },
        "allow_custom_instance": {
          "type": "boolean"
        }
      }
    },
    "app_updater": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "check_automatically": {
          "type": "boolean"
        },
        "app_manager_base_url": {
          "type": "string",
          "minLength": 1,
          "pattern": "^https?://[^\\s]+$",
          "format": "uri"
        },
        "app_channel": {
          "type": "string",
          "minLength": 1,
          "pattern": "\\S"
        },
        "app_cast_url": {
          "type": "string",
          "minLength": 1,
          "pattern": "^https?://[^\\s]+$",
          "format": "uri"
        }
      }
    },
    "analytics": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "url": {
          "type": "string",
          "minLength": 1,
          "pattern": "^https?://[^\\s]+$",
          "format": "uri"
        },
        "client_id": {
          "type": "string",
          "minLength": 1,
          "pattern": "\\S"
        },
        "client_secret": {
          "type": "string"
        },
        "release_channel": {
          "type": "string",
          "minLength": 1,
          "pattern": "\\S"
        }
      }
    },
    "sentry": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "dsn": {
          "anyOf": [
            {
              "const": ""
            },
            {
              "type": "string",
              "minLength": 1,
              "pattern": "^https?://[^\\s]+$",
              "format": "uri"
            }
          ]
        },
        "release": {
          "type": "string",
          "minLength": 1,
          "pattern": "\\S"
        },
        "dist": {
          "type": "string",
          "minLength": 1,
          "pattern": "\\S"
        },
        "environment": {
          "type": "string",
          "minLength": 1,
          "pattern": "\\S"
        },
        "traces_sample_rate": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        }
      }
    },
    "authentication": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "sso_browser_mode": {
          "type": "string",
          "enum": [
            "system",
            "integrated"
          ],
          "default": "system"
        },
        "allow_integrated_sso": {
          "type": "boolean",
          "default": true
        }
      }
    },
    "feature_flags": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "scripto": {
          "type": "string",
          "enum": [
            "enabled",
            "hidden",
            "disabled"
          ]
        },
        "tools": {
          "type": "string",
          "enum": [
            "enabled",
            "hidden",
            "disabled"
          ]
        },
        "additional_languages": {
          "type": "string",
          "enum": [
            "enabled",
            "hidden",
            "disabled"
          ]
        },
        "computer_use": {
          "type": "string",
          "enum": [
            "enabled",
            "hidden",
            "disabled"
          ]
        },
        "apps": {
          "type": "string",
          "enum": [
            "enabled",
            "hidden",
            "disabled"
          ]
        },
        "medical_knowledge": {
          "type": "string",
          "enum": [
            "enabled",
            "hidden",
            "disabled"
          ]
        },
        "chat": {
          "type": "string",
          "enum": [
            "enabled",
            "hidden",
            "disabled"
          ]
        },
        "test_server": {
          "type": "string",
          "enum": [
            "enabled",
            "hidden",
            "disabled"
          ]
        },
        "generate_options": {
          "type": "string",
          "enum": [
            "enabled",
            "hidden",
            "disabled"
          ]
        },
        "realtime_transcription_preview": {
          "type": "string",
          "enum": [
            "enabled",
            "hidden",
            "disabled"
          ]
        },
        "hey_dicto": {
          "type": "string",
          "enum": [
            "enabled",
            "hidden",
            "disabled"
          ]
        },
        "mcp_server": {
          "type": "string",
          "enum": [
            "enabled",
            "hidden",
            "disabled"
          ]
        }
      }
    }
  }
}
