{
  "$defs": {
    "RawCredentialProxySection": {
      "additionalProperties": false,
      "description": "Global ``credential_proxy:`` section.",
      "properties": {
        "bypass_no_secret_protection": {
          "default": false,
          "title": "Bypass No Secret Protection",
          "type": "boolean"
        },
        "transport": {
          "default": "socket",
          "enum": [
            "direct",
            "socket"
          ],
          "title": "Transport",
          "type": "string"
        }
      },
      "title": "RawCredentialProxySection",
      "type": "object"
    },
    "RawCredentialsSection": {
      "additionalProperties": false,
      "description": "Global ``credentials:`` section.",
      "properties": {
        "dir": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Dir"
        }
      },
      "title": "RawCredentialsSection",
      "type": "object"
    },
    "RawGateServerSection": {
      "additionalProperties": false,
      "description": "Global ``gate_server:`` section.",
      "properties": {
        "port": {
          "default": 9418,
          "title": "Port",
          "type": "integer"
        },
        "repos_dir": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Repos Dir"
        },
        "suppress_systemd_warning": {
          "default": false,
          "title": "Suppress Systemd Warning",
          "type": "boolean"
        }
      },
      "title": "RawGateServerSection",
      "type": "object"
    },
    "RawGlobalGitSection": {
      "additionalProperties": false,
      "description": "The ``git:`` section of global config.yml (identity fields only).",
      "properties": {
        "human_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Human Name"
        },
        "human_email": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Human Email"
        },
        "authorship": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Authorship"
        }
      },
      "title": "RawGlobalGitSection",
      "type": "object"
    },
    "RawHooksSection": {
      "additionalProperties": false,
      "description": "Task lifecycle hook commands (run on host, not inside containers).",
      "properties": {
        "pre_start": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Pre Start"
        },
        "post_start": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Post Start"
        },
        "post_ready": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Post Ready"
        },
        "post_stop": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Post Stop"
        }
      },
      "title": "RawHooksSection",
      "type": "object"
    },
    "RawLogsSection": {
      "additionalProperties": false,
      "description": "Global ``logs:`` section.",
      "properties": {
        "partial_streaming": {
          "default": true,
          "title": "Partial Streaming",
          "type": "boolean"
        }
      },
      "title": "RawLogsSection",
      "type": "object"
    },
    "RawPathsSection": {
      "additionalProperties": false,
      "description": "Global ``paths:`` section.",
      "properties": {
        "state_dir": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "State Dir"
        },
        "build_dir": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Build Dir"
        },
        "user_projects_dir": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "User Projects Dir"
        },
        "user_presets_dir": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "User Presets Dir"
        }
      },
      "title": "RawPathsSection",
      "type": "object"
    },
    "RawShieldGlobalSection": {
      "additionalProperties": false,
      "description": "Global ``shield:`` section.",
      "properties": {
        "bypass_firewall_no_protection": {
          "default": false,
          "title": "Bypass Firewall No Protection",
          "type": "boolean"
        },
        "profiles": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Profiles"
        },
        "audit": {
          "default": true,
          "title": "Audit",
          "type": "boolean"
        },
        "drop_on_task_run": {
          "default": true,
          "title": "Drop On Task Run",
          "type": "boolean"
        },
        "on_task_restart": {
          "default": "retain",
          "enum": [
            "retain",
            "up"
          ],
          "title": "On Task Restart",
          "type": "string"
        }
      },
      "title": "RawShieldGlobalSection",
      "type": "object"
    },
    "RawTUISection": {
      "additionalProperties": false,
      "description": "Global ``tui:`` section.",
      "properties": {
        "default_tmux": {
          "default": false,
          "title": "Default Tmux",
          "type": "boolean"
        }
      },
      "title": "RawTUISection",
      "type": "object"
    },
    "RawTasksGlobalSection": {
      "additionalProperties": false,
      "description": "Global ``tasks:`` section.",
      "properties": {
        "name_categories": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Name Categories"
        }
      },
      "title": "RawTasksGlobalSection",
      "type": "object"
    },
    "RawUISection": {
      "additionalProperties": false,
      "description": "Global ``ui:`` section.",
      "properties": {
        "base_port": {
          "default": 7860,
          "title": "Base Port",
          "type": "integer"
        }
      },
      "title": "RawUISection",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "description": "Validated structure of the global ``config.yml`` file.",
  "properties": {
    "ui": {
      "$ref": "#/$defs/RawUISection"
    },
    "credentials": {
      "$ref": "#/$defs/RawCredentialsSection"
    },
    "paths": {
      "$ref": "#/$defs/RawPathsSection"
    },
    "tui": {
      "$ref": "#/$defs/RawTUISection"
    },
    "logs": {
      "$ref": "#/$defs/RawLogsSection"
    },
    "shield": {
      "$ref": "#/$defs/RawShieldGlobalSection"
    },
    "credential_proxy": {
      "$ref": "#/$defs/RawCredentialProxySection"
    },
    "gate_server": {
      "$ref": "#/$defs/RawGateServerSection"
    },
    "tasks": {
      "$ref": "#/$defs/RawTasksGlobalSection"
    },
    "git": {
      "$ref": "#/$defs/RawGlobalGitSection"
    },
    "hooks": {
      "$ref": "#/$defs/RawHooksSection"
    },
    "default_agent": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Default Agent"
    },
    "default_login": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Default Login"
    },
    "agent": {
      "additionalProperties": true,
      "title": "Agent",
      "type": "object"
    }
  },
  "title": "terok config.yml",
  "type": "object",
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
