{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://weverlabs.com/schemas/runtime-data-binding-map.schema.json",
  "title": "Wever Labs Runtime Data Binding Map",
  "type": "object",
  "required": [
    "binding_id",
    "tool",
    "task_token",
    "binding_sequence",
    "records"
  ],
  "properties": {
    "binding_id": {
      "type": "string"
    },
    "tool": {
      "type": "string"
    },
    "task_token": {
      "type": "string"
    },
    "agent_id": {
      "type": "string"
    },
    "binding_sequence": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "records": {
      "type": "array",
      "items": {
        "$ref": "https://weverlabs.com/schemas/runtime-os-record.schema.json"
      }
    },
    "table_map": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "table",
          "record_type"
        ],
        "properties": {
          "table": {
            "type": "string"
          },
          "record_type": {
            "type": "string"
          },
          "primary_key": {
            "type": "string"
          },
          "foreign_keys": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    },
    "console_url": {
      "type": "string",
      "format": "uri"
    },
    "support_url": {
      "type": "string",
      "format": "uri"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "additionalProperties": false
}
