{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://swl-ses.dev/schemas/hooks-config.json",
  "title": "SWL Hooks Config",
  "description": "Schema para hooks-config.json del sistema SWL",
  "type": "object",
  "required": ["descripcion", "hooks"],
  "properties": {
    "descripcion": {
      "type": "string"
    },
    "riskThresholds": {
      "type": "object",
      "required": ["allow", "review", "confirm"],
      "properties": {
        "allow": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "review": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "confirm": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        }
      }
    },
    "costBudget": {
      "type": "object",
      "properties": {
        "maxUsd": {
          "type": "number",
          "minimum": 0
        },
        "maxTokens": {
          "type": "integer",
          "minimum": 0
        },
        "alertAt": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        }
      }
    },
    "hooks": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "required": ["event", "description", "blocking"],
        "properties": {
          "event": {
            "type": "string",
            "enum": ["PreToolUse", "PostToolUse"]
          },
          "matcher": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "blocking": {
            "type": "boolean"
          }
        }
      }
    }
  }
}
