{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/xiaojiou176-open/Switchyard/docs/builder-intent-router.schema.json",
  "title": "Switchyard Builder Intent Router",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "$schema",
    "routerVersion",
    "intents"
  ],
  "properties": {
    "$schema": {
      "type": "string"
    },
    "routerVersion": {
      "type": "integer",
      "minimum": 1
    },
    "intents": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/intent"
      }
    }
  },
  "$defs": {
    "stringArray": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "intent": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "question",
        "firstHopDoc",
        "firstHopCli",
        "firstHopMcp",
        "whyThisFirst",
        "doNotStartWith",
        "truthReminder",
        "relatedDocs",
        "searchKeywords"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "question": {
          "type": "string",
          "minLength": 1
        },
        "firstHopDoc": {
          "type": "string",
          "minLength": 1
        },
        "firstHopCli": {
          "type": "string",
          "minLength": 1
        },
        "firstHopMcp": {
          "type": "string",
          "minLength": 1
        },
        "whyThisFirst": {
          "$ref": "#/$defs/stringArray"
        },
        "doNotStartWith": {
          "$ref": "#/$defs/stringArray"
        },
        "truthReminder": {
          "$ref": "#/$defs/stringArray"
        },
        "relatedDocs": {
          "$ref": "#/$defs/stringArray"
        },
        "searchKeywords": {
          "$ref": "#/$defs/stringArray"
        }
      }
    }
  }
}
