{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "/agent-protocol.json",
  "title": "draw AgentPlan",
  "type": "object",
  "required": ["actions"],
  "properties": {
    "title": { "type": "string", "maxLength": 48 },
    "summary": { "type": "string" },
    "actions": {
      "type": "array",
      "maxItems": 80,
      "items": {
        "oneOf": [
          {
            "type": "object",
            "required": ["op", "id", "type", "label", "col", "row"],
            "properties": {
              "op": { "const": "add_node" },
              "id": { "type": "string" },
              "type": {
                "type": "string",
                "enum": [
                  "internet", "router", "switch", "wifi-ap",
                  "firewall", "waf", "proxy", "load-balancer", "vpn",
                  "identity", "email-gw", "saas", "server", "database", "storage",
                  "desktop", "laptop", "mobile", "iot",
                  "threat-actor", "malware", "c2-server", "phishing", "botnet", "insider"
                ]
              },
              "label": { "type": "string", "maxLength": 24 },
              "col": { "type": "number" },
              "row": { "type": "number" },
              "meta": { "type": "object", "additionalProperties": { "type": "string" } }
            }
          },
          {
            "type": "object",
            "required": ["op", "from", "to"],
            "properties": {
              "op": { "const": "add_edge" },
              "from": { "type": "string" },
              "to": { "type": "string" },
              "label": { "type": "string" },
              "style": { "enum": ["solid", "dashed", "dotted"] },
              "color": { "type": "string" }
            }
          },
          {
            "type": "object",
            "required": ["op", "id", "label", "c0", "r0", "c1", "r1"],
            "properties": {
              "op": { "const": "add_zone" },
              "id": { "type": "string" },
              "label": { "type": "string" },
              "color": { "type": "string" },
              "c0": { "type": "number" },
              "r0": { "type": "number" },
              "c1": { "type": "number" },
              "r1": { "type": "number" }
            }
          },
          {
            "type": "object",
            "required": ["op", "text"],
            "properties": {
              "op": { "const": "note" },
              "text": { "type": "string" }
            }
          }
        ]
      }
    }
  }
}
