{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://weverlabs.com/schemas/runtime-function-wiring.schema.json",
  "title": "Wever Labs Runtime Function Wiring",
  "type": "object",
  "required": [
    "wiring_id",
    "function_name",
    "runtime_target",
    "supabase_table",
    "state"
  ],
  "properties": {
    "wiring_id": {
      "type": "string"
    },
    "function_name": {
      "type": "string"
    },
    "runtime_target": {
      "type": "string"
    },
    "supabase_table": {
      "type": "string"
    },
    "state": {
      "type": "string",
      "enum": [
        "wired",
        "accepted",
        "persisted",
        "error"
      ]
    },
    "record_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "task_token": {
      "type": [
        "string",
        "null"
      ]
    },
    "next_action": {
      "type": [
        "string",
        "null"
      ]
    },
    "links": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "payload": {
      "type": "object"
    }
  }
}