{
  "$defs": {
    "AnnotationEvent": {
      "additionalProperties": false,
      "properties": {
        "event_id": {
          "format": "uuid",
          "title": "Event Id",
          "type": "string"
        },
        "tenant_id": {
          "title": "Tenant Id",
          "type": "string"
        },
        "vendor_id": {
          "title": "Vendor Id",
          "type": "string"
        },
        "session_id": {
          "title": "Session Id",
          "type": "string"
        },
        "sequence_number": {
          "minimum": 0,
          "title": "Sequence Number",
          "type": "integer"
        },
        "captured_at": {
          "format": "date-time",
          "title": "Captured At",
          "type": "string"
        },
        "consent_token": {
          "title": "Consent Token",
          "type": "string"
        },
        "sdk_version": {
          "default": "1.0.0",
          "title": "Sdk Version",
          "type": "string"
        },
        "agent_runtime": {
          "default": "unknown",
          "title": "Agent Runtime",
          "type": "string"
        },
        "client_observed": {
          "anyOf": [
            {
              "$ref": "#/$defs/ClientObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "principal": {
          "anyOf": [
            {
              "$ref": "#/$defs/PrincipalWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "organization": {
          "anyOf": [
            {
              "$ref": "#/$defs/OrganizationWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "labels": {
          "anyOf": [
            {
              "items": {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              },
              "maxItems": 20,
              "minItems": 1,
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Labels"
        },
        "capture": {
          "anyOf": [
            {
              "$ref": "#/$defs/CaptureObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "call_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Call Id"
        },
        "transport_observed": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Transport Observed"
        },
        "session_id_origin": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Session Id Origin"
        },
        "runtime_meta": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Runtime Meta"
        },
        "event_type": {
          "const": "annotation",
          "default": "annotation",
          "title": "Event Type",
          "type": "string"
        },
        "payload": {
          "$ref": "#/$defs/AnnotationPayload"
        }
      },
      "required": [
        "tenant_id",
        "vendor_id",
        "session_id",
        "sequence_number",
        "captured_at",
        "consent_token",
        "payload"
      ],
      "title": "AnnotationEvent",
      "type": "object"
    },
    "AnnotationPayload": {
      "additionalProperties": false,
      "description": "Agent-supplied context. All fields nullable per SPEC \u00a75.1.1. A filled\n``what_happened`` makes the annotation a report (SPEC \u00a711.4); without it\nthe annotation is a note carrying ``intent``. ``expected_outcome`` and\n``workflow`` come only from the library API and older producers.",
      "properties": {
        "intent": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Intent"
        },
        "expected_outcome": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Expected Outcome"
        },
        "what_happened": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "What Happened"
        },
        "signal_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Signal Type"
        },
        "workflow": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Workflow"
        },
        "suggested_improvement": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Suggested Improvement"
        },
        "context": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Context"
        },
        "tool_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Tool Name"
        }
      },
      "title": "AnnotationPayload",
      "type": "object"
    },
    "CaptureObserved": {
      "additionalProperties": false,
      "description": "Which collector settings a call ran under (SPEC \u00a711.4, \u00a72.6).",
      "properties": {
        "settings_version": {
          "anyOf": [
            {
              "minimum": 1,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Settings Version"
        },
        "audience": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Audience"
        },
        "overlay": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Overlay"
        }
      },
      "title": "CaptureObserved",
      "type": "object"
    },
    "ClientInfoObserved": {
      "additionalProperties": false,
      "description": "A client's ``clientInfo`` as it declared it.",
      "properties": {
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Name"
        },
        "version": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Version"
        }
      },
      "title": "ClientInfoObserved",
      "type": "object"
    },
    "ClientObserved": {
      "additionalProperties": false,
      "description": "What the client said about itself, uninterpreted (SPEC \u00a711.4).",
      "properties": {
        "info": {
          "anyOf": [
            {
              "$ref": "#/$defs/ClientInfoObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "headers": {
          "anyOf": [
            {
              "additionalProperties": {
                "type": "string"
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Headers"
        }
      },
      "title": "ClientObserved",
      "type": "object"
    },
    "ClientReportEvent": {
      "additionalProperties": false,
      "properties": {
        "event_id": {
          "format": "uuid",
          "title": "Event Id",
          "type": "string"
        },
        "tenant_id": {
          "title": "Tenant Id",
          "type": "string"
        },
        "vendor_id": {
          "title": "Vendor Id",
          "type": "string"
        },
        "session_id": {
          "title": "Session Id",
          "type": "string"
        },
        "sequence_number": {
          "minimum": 0,
          "title": "Sequence Number",
          "type": "integer"
        },
        "captured_at": {
          "format": "date-time",
          "title": "Captured At",
          "type": "string"
        },
        "consent_token": {
          "title": "Consent Token",
          "type": "string"
        },
        "sdk_version": {
          "default": "1.0.0",
          "title": "Sdk Version",
          "type": "string"
        },
        "agent_runtime": {
          "default": "unknown",
          "title": "Agent Runtime",
          "type": "string"
        },
        "client_observed": {
          "anyOf": [
            {
              "$ref": "#/$defs/ClientObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "principal": {
          "anyOf": [
            {
              "$ref": "#/$defs/PrincipalWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "organization": {
          "anyOf": [
            {
              "$ref": "#/$defs/OrganizationWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "labels": {
          "anyOf": [
            {
              "items": {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              },
              "maxItems": 20,
              "minItems": 1,
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Labels"
        },
        "capture": {
          "anyOf": [
            {
              "$ref": "#/$defs/CaptureObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "call_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Call Id"
        },
        "transport_observed": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Transport Observed"
        },
        "session_id_origin": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Session Id Origin"
        },
        "runtime_meta": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Runtime Meta"
        },
        "event_type": {
          "const": "client_report",
          "default": "client_report",
          "title": "Event Type",
          "type": "string"
        },
        "payload": {
          "$ref": "#/$defs/ClientReportPayload"
        }
      },
      "required": [
        "tenant_id",
        "vendor_id",
        "session_id",
        "sequence_number",
        "captured_at",
        "consent_token",
        "payload"
      ],
      "title": "ClientReportEvent",
      "type": "object"
    },
    "ClientReportPayload": {
      "additionalProperties": false,
      "description": "This process's lost-event counts by reason, as running totals (SPEC \u00a711.4.7).",
      "properties": {
        "instance_id": {
          "format": "uuid",
          "title": "Instance Id",
          "type": "string"
        },
        "dropped": {
          "additionalProperties": {
            "minimum": 0,
            "type": "integer"
          },
          "title": "Dropped",
          "type": "object"
        }
      },
      "required": [
        "instance_id",
        "dropped"
      ],
      "title": "ClientReportPayload",
      "type": "object"
    },
    "OrganizationWire": {
      "additionalProperties": false,
      "description": "The organization AS EMITTED (SPEC \u00a711.4): the company the caller\nbelongs to, with ``principal``'s members and rules and its own ``form``.",
      "properties": {
        "id": {
          "title": "Id",
          "type": "string"
        },
        "source": {
          "title": "Source",
          "type": "string"
        },
        "form": {
          "title": "Form",
          "type": "string"
        },
        "display_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Display Name"
        }
      },
      "required": [
        "id",
        "source",
        "form"
      ],
      "title": "OrganizationWire",
      "type": "object"
    },
    "PrincipalWire": {
      "additionalProperties": false,
      "description": "The principal AS EMITTED \u2014 the finished envelope value (SPEC \u00a711.4).\n\n\u26a0 **Not ``baton.Principal``, and the two are easy to confuse.** That one is\nwhat a vendor's ``resolve_principal`` hook HANDS US. This one is what we\nPUT ON THE WIRE: the same value, with ``source`` added.\n\n**The first three members are REQUIRED, and that is the guarantee the\nobject exists to give.** A producer emits all three or omits\n``principal`` entirely (``display_name`` rides only on a complete object); a partial object is malformed, not a degraded reading. So there\nis no conformant event carrying an ``id`` whose ``form`` a consumer has to\nguess, and none carrying a ``source`` for an identity nobody resolved. That\nbinding is structural here precisely because its predecessor \u2014 a scheme\nprefix plus a paragraph of prose \u2014 was not.",
      "properties": {
        "id": {
          "title": "Id",
          "type": "string"
        },
        "source": {
          "title": "Source",
          "type": "string"
        },
        "form": {
          "title": "Form",
          "type": "string"
        },
        "display_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Display Name"
        }
      },
      "required": [
        "id",
        "source",
        "form"
      ],
      "title": "PrincipalWire",
      "type": "object"
    },
    "PromptGetEndEvent": {
      "additionalProperties": false,
      "properties": {
        "event_id": {
          "format": "uuid",
          "title": "Event Id",
          "type": "string"
        },
        "tenant_id": {
          "title": "Tenant Id",
          "type": "string"
        },
        "vendor_id": {
          "title": "Vendor Id",
          "type": "string"
        },
        "session_id": {
          "title": "Session Id",
          "type": "string"
        },
        "sequence_number": {
          "minimum": 0,
          "title": "Sequence Number",
          "type": "integer"
        },
        "captured_at": {
          "format": "date-time",
          "title": "Captured At",
          "type": "string"
        },
        "consent_token": {
          "title": "Consent Token",
          "type": "string"
        },
        "sdk_version": {
          "default": "1.0.0",
          "title": "Sdk Version",
          "type": "string"
        },
        "agent_runtime": {
          "default": "unknown",
          "title": "Agent Runtime",
          "type": "string"
        },
        "client_observed": {
          "anyOf": [
            {
              "$ref": "#/$defs/ClientObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "principal": {
          "anyOf": [
            {
              "$ref": "#/$defs/PrincipalWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "organization": {
          "anyOf": [
            {
              "$ref": "#/$defs/OrganizationWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "labels": {
          "anyOf": [
            {
              "items": {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              },
              "maxItems": 20,
              "minItems": 1,
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Labels"
        },
        "capture": {
          "anyOf": [
            {
              "$ref": "#/$defs/CaptureObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "call_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Call Id"
        },
        "transport_observed": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Transport Observed"
        },
        "session_id_origin": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Session Id Origin"
        },
        "runtime_meta": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Runtime Meta"
        },
        "event_type": {
          "const": "prompt_get_end",
          "default": "prompt_get_end",
          "title": "Event Type",
          "type": "string"
        },
        "payload": {
          "$ref": "#/$defs/PromptGetEndPayload"
        }
      },
      "required": [
        "tenant_id",
        "vendor_id",
        "session_id",
        "sequence_number",
        "captured_at",
        "consent_token",
        "payload"
      ],
      "title": "PromptGetEndEvent",
      "type": "object"
    },
    "PromptGetEndPayload": {
      "additionalProperties": false,
      "description": "Emitted after ``prompts/get`` returns.\n\n\u26a0 **No rendered messages**, for the reason ``ResourceReadEndPayload``\ngives. A prompt's rendered text is authored by the SERVER rather than\nfetched by a tool, so whether it is customer content at all is a decision\nnobody has taken \u2014 and the standing answer, from the only producer, is that\nit does not egress.",
      "properties": {
        "name": {
          "title": "Name",
          "type": "string"
        },
        "duration_ms": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Duration Ms"
        }
      },
      "required": [
        "name"
      ],
      "title": "PromptGetEndPayload",
      "type": "object"
    },
    "PromptGetErrorEvent": {
      "additionalProperties": false,
      "properties": {
        "event_id": {
          "format": "uuid",
          "title": "Event Id",
          "type": "string"
        },
        "tenant_id": {
          "title": "Tenant Id",
          "type": "string"
        },
        "vendor_id": {
          "title": "Vendor Id",
          "type": "string"
        },
        "session_id": {
          "title": "Session Id",
          "type": "string"
        },
        "sequence_number": {
          "minimum": 0,
          "title": "Sequence Number",
          "type": "integer"
        },
        "captured_at": {
          "format": "date-time",
          "title": "Captured At",
          "type": "string"
        },
        "consent_token": {
          "title": "Consent Token",
          "type": "string"
        },
        "sdk_version": {
          "default": "1.0.0",
          "title": "Sdk Version",
          "type": "string"
        },
        "agent_runtime": {
          "default": "unknown",
          "title": "Agent Runtime",
          "type": "string"
        },
        "client_observed": {
          "anyOf": [
            {
              "$ref": "#/$defs/ClientObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "principal": {
          "anyOf": [
            {
              "$ref": "#/$defs/PrincipalWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "organization": {
          "anyOf": [
            {
              "$ref": "#/$defs/OrganizationWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "labels": {
          "anyOf": [
            {
              "items": {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              },
              "maxItems": 20,
              "minItems": 1,
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Labels"
        },
        "capture": {
          "anyOf": [
            {
              "$ref": "#/$defs/CaptureObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "call_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Call Id"
        },
        "transport_observed": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Transport Observed"
        },
        "session_id_origin": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Session Id Origin"
        },
        "runtime_meta": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Runtime Meta"
        },
        "event_type": {
          "const": "prompt_get_error",
          "default": "prompt_get_error",
          "title": "Event Type",
          "type": "string"
        },
        "payload": {
          "$ref": "#/$defs/PromptGetErrorPayload"
        }
      },
      "required": [
        "tenant_id",
        "vendor_id",
        "session_id",
        "sequence_number",
        "captured_at",
        "consent_token",
        "payload"
      ],
      "title": "PromptGetErrorEvent",
      "type": "object"
    },
    "PromptGetErrorPayload": {
      "additionalProperties": false,
      "description": "Emitted when ``prompts/get`` failed. See ``ResourceReadErrorPayload``\nfor how ``error_type`` is spelled and why ``error_body`` is kept.",
      "properties": {
        "name": {
          "title": "Name",
          "type": "string"
        },
        "error_type": {
          "title": "Error Type",
          "type": "string"
        },
        "error_body": {
          "title": "Error Body",
          "type": "string"
        },
        "duration_ms": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Duration Ms"
        }
      },
      "required": [
        "name",
        "error_type",
        "error_body"
      ],
      "title": "PromptGetErrorPayload",
      "type": "object"
    },
    "PromptGetStartEvent": {
      "additionalProperties": false,
      "properties": {
        "event_id": {
          "format": "uuid",
          "title": "Event Id",
          "type": "string"
        },
        "tenant_id": {
          "title": "Tenant Id",
          "type": "string"
        },
        "vendor_id": {
          "title": "Vendor Id",
          "type": "string"
        },
        "session_id": {
          "title": "Session Id",
          "type": "string"
        },
        "sequence_number": {
          "minimum": 0,
          "title": "Sequence Number",
          "type": "integer"
        },
        "captured_at": {
          "format": "date-time",
          "title": "Captured At",
          "type": "string"
        },
        "consent_token": {
          "title": "Consent Token",
          "type": "string"
        },
        "sdk_version": {
          "default": "1.0.0",
          "title": "Sdk Version",
          "type": "string"
        },
        "agent_runtime": {
          "default": "unknown",
          "title": "Agent Runtime",
          "type": "string"
        },
        "client_observed": {
          "anyOf": [
            {
              "$ref": "#/$defs/ClientObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "principal": {
          "anyOf": [
            {
              "$ref": "#/$defs/PrincipalWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "organization": {
          "anyOf": [
            {
              "$ref": "#/$defs/OrganizationWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "labels": {
          "anyOf": [
            {
              "items": {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              },
              "maxItems": 20,
              "minItems": 1,
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Labels"
        },
        "capture": {
          "anyOf": [
            {
              "$ref": "#/$defs/CaptureObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "call_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Call Id"
        },
        "transport_observed": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Transport Observed"
        },
        "session_id_origin": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Session Id Origin"
        },
        "runtime_meta": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Runtime Meta"
        },
        "event_type": {
          "const": "prompt_get_start",
          "default": "prompt_get_start",
          "title": "Event Type",
          "type": "string"
        },
        "payload": {
          "$ref": "#/$defs/PromptGetStartPayload"
        }
      },
      "required": [
        "tenant_id",
        "vendor_id",
        "session_id",
        "sequence_number",
        "captured_at",
        "consent_token",
        "payload"
      ],
      "title": "PromptGetStartEvent",
      "type": "object"
    },
    "PromptGetStartPayload": {
      "additionalProperties": false,
      "description": "Emitted before a ``prompts/get`` reaches the upstream server.\n\n\u26a0 ``params`` is the request's ``arguments`` member alone, NOT the whole\nparams bag \u2014 which is the opposite of ``ResourceReadStartPayload``'s\nchoice, measured in ``proxy.py`` (``params=params.get(\"arguments\")``\nagainst the resource path's dict comprehension). The two are inconsistent\nin the only producer that exists; the inconsistency is recorded here so a\nsecond producer copies the shape rather than guessing at a rule, and so a\nconsumer does not expect ``name`` inside ``params`` the way ``uri`` does\nappear there.",
      "properties": {
        "name": {
          "title": "Name",
          "type": "string"
        },
        "params": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Params"
        }
      },
      "required": [
        "name"
      ],
      "title": "PromptGetStartPayload",
      "type": "object"
    },
    "PromptListEndEvent": {
      "additionalProperties": false,
      "properties": {
        "event_id": {
          "format": "uuid",
          "title": "Event Id",
          "type": "string"
        },
        "tenant_id": {
          "title": "Tenant Id",
          "type": "string"
        },
        "vendor_id": {
          "title": "Vendor Id",
          "type": "string"
        },
        "session_id": {
          "title": "Session Id",
          "type": "string"
        },
        "sequence_number": {
          "minimum": 0,
          "title": "Sequence Number",
          "type": "integer"
        },
        "captured_at": {
          "format": "date-time",
          "title": "Captured At",
          "type": "string"
        },
        "consent_token": {
          "title": "Consent Token",
          "type": "string"
        },
        "sdk_version": {
          "default": "1.0.0",
          "title": "Sdk Version",
          "type": "string"
        },
        "agent_runtime": {
          "default": "unknown",
          "title": "Agent Runtime",
          "type": "string"
        },
        "client_observed": {
          "anyOf": [
            {
              "$ref": "#/$defs/ClientObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "principal": {
          "anyOf": [
            {
              "$ref": "#/$defs/PrincipalWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "organization": {
          "anyOf": [
            {
              "$ref": "#/$defs/OrganizationWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "labels": {
          "anyOf": [
            {
              "items": {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              },
              "maxItems": 20,
              "minItems": 1,
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Labels"
        },
        "capture": {
          "anyOf": [
            {
              "$ref": "#/$defs/CaptureObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "call_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Call Id"
        },
        "transport_observed": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Transport Observed"
        },
        "session_id_origin": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Session Id Origin"
        },
        "runtime_meta": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Runtime Meta"
        },
        "event_type": {
          "const": "prompt_list_end",
          "default": "prompt_list_end",
          "title": "Event Type",
          "type": "string"
        },
        "payload": {
          "$ref": "#/$defs/PromptListEndPayload"
        }
      },
      "required": [
        "tenant_id",
        "vendor_id",
        "session_id",
        "sequence_number",
        "captured_at",
        "consent_token",
        "payload"
      ],
      "title": "PromptListEndEvent",
      "type": "object"
    },
    "PromptListEndPayload": {
      "additionalProperties": false,
      "description": "Emitted after ``prompts/list`` returns. ``count`` counts the ``prompts``\narray.",
      "properties": {
        "count": {
          "title": "Count",
          "type": "integer"
        },
        "duration_ms": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Duration Ms"
        }
      },
      "required": [
        "count"
      ],
      "title": "PromptListEndPayload",
      "type": "object"
    },
    "PromptListErrorEvent": {
      "additionalProperties": false,
      "properties": {
        "event_id": {
          "format": "uuid",
          "title": "Event Id",
          "type": "string"
        },
        "tenant_id": {
          "title": "Tenant Id",
          "type": "string"
        },
        "vendor_id": {
          "title": "Vendor Id",
          "type": "string"
        },
        "session_id": {
          "title": "Session Id",
          "type": "string"
        },
        "sequence_number": {
          "minimum": 0,
          "title": "Sequence Number",
          "type": "integer"
        },
        "captured_at": {
          "format": "date-time",
          "title": "Captured At",
          "type": "string"
        },
        "consent_token": {
          "title": "Consent Token",
          "type": "string"
        },
        "sdk_version": {
          "default": "1.0.0",
          "title": "Sdk Version",
          "type": "string"
        },
        "agent_runtime": {
          "default": "unknown",
          "title": "Agent Runtime",
          "type": "string"
        },
        "client_observed": {
          "anyOf": [
            {
              "$ref": "#/$defs/ClientObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "principal": {
          "anyOf": [
            {
              "$ref": "#/$defs/PrincipalWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "organization": {
          "anyOf": [
            {
              "$ref": "#/$defs/OrganizationWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "labels": {
          "anyOf": [
            {
              "items": {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              },
              "maxItems": 20,
              "minItems": 1,
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Labels"
        },
        "capture": {
          "anyOf": [
            {
              "$ref": "#/$defs/CaptureObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "call_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Call Id"
        },
        "transport_observed": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Transport Observed"
        },
        "session_id_origin": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Session Id Origin"
        },
        "runtime_meta": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Runtime Meta"
        },
        "event_type": {
          "const": "prompt_list_error",
          "default": "prompt_list_error",
          "title": "Event Type",
          "type": "string"
        },
        "payload": {
          "$ref": "#/$defs/PromptListErrorPayload"
        }
      },
      "required": [
        "tenant_id",
        "vendor_id",
        "session_id",
        "sequence_number",
        "captured_at",
        "consent_token",
        "payload"
      ],
      "title": "PromptListErrorEvent",
      "type": "object"
    },
    "PromptListErrorPayload": {
      "additionalProperties": false,
      "description": "Emitted when ``prompts/list`` failed. See\n``ResourceReadErrorPayload`` for how ``error_type`` is spelled.",
      "properties": {
        "error_type": {
          "title": "Error Type",
          "type": "string"
        },
        "error_body": {
          "title": "Error Body",
          "type": "string"
        },
        "duration_ms": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Duration Ms"
        }
      },
      "required": [
        "error_type",
        "error_body"
      ],
      "title": "PromptListErrorPayload",
      "type": "object"
    },
    "PromptListStartEvent": {
      "additionalProperties": false,
      "properties": {
        "event_id": {
          "format": "uuid",
          "title": "Event Id",
          "type": "string"
        },
        "tenant_id": {
          "title": "Tenant Id",
          "type": "string"
        },
        "vendor_id": {
          "title": "Vendor Id",
          "type": "string"
        },
        "session_id": {
          "title": "Session Id",
          "type": "string"
        },
        "sequence_number": {
          "minimum": 0,
          "title": "Sequence Number",
          "type": "integer"
        },
        "captured_at": {
          "format": "date-time",
          "title": "Captured At",
          "type": "string"
        },
        "consent_token": {
          "title": "Consent Token",
          "type": "string"
        },
        "sdk_version": {
          "default": "1.0.0",
          "title": "Sdk Version",
          "type": "string"
        },
        "agent_runtime": {
          "default": "unknown",
          "title": "Agent Runtime",
          "type": "string"
        },
        "client_observed": {
          "anyOf": [
            {
              "$ref": "#/$defs/ClientObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "principal": {
          "anyOf": [
            {
              "$ref": "#/$defs/PrincipalWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "organization": {
          "anyOf": [
            {
              "$ref": "#/$defs/OrganizationWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "labels": {
          "anyOf": [
            {
              "items": {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              },
              "maxItems": 20,
              "minItems": 1,
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Labels"
        },
        "capture": {
          "anyOf": [
            {
              "$ref": "#/$defs/CaptureObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "call_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Call Id"
        },
        "transport_observed": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Transport Observed"
        },
        "session_id_origin": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Session Id Origin"
        },
        "runtime_meta": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Runtime Meta"
        },
        "event_type": {
          "const": "prompt_list_start",
          "default": "prompt_list_start",
          "title": "Event Type",
          "type": "string"
        },
        "payload": {
          "$ref": "#/$defs/PromptListStartPayload"
        }
      },
      "required": [
        "tenant_id",
        "vendor_id",
        "session_id",
        "sequence_number",
        "captured_at",
        "consent_token",
        "payload"
      ],
      "title": "PromptListStartEvent",
      "type": "object"
    },
    "PromptListStartPayload": {
      "additionalProperties": false,
      "description": "Emitted before a ``prompts/list`` reaches the upstream server. Empty,\nfor the reason ``ResourceListStartPayload`` carries.",
      "properties": {},
      "title": "PromptListStartPayload",
      "type": "object"
    },
    "ResourceListEndEvent": {
      "additionalProperties": false,
      "properties": {
        "event_id": {
          "format": "uuid",
          "title": "Event Id",
          "type": "string"
        },
        "tenant_id": {
          "title": "Tenant Id",
          "type": "string"
        },
        "vendor_id": {
          "title": "Vendor Id",
          "type": "string"
        },
        "session_id": {
          "title": "Session Id",
          "type": "string"
        },
        "sequence_number": {
          "minimum": 0,
          "title": "Sequence Number",
          "type": "integer"
        },
        "captured_at": {
          "format": "date-time",
          "title": "Captured At",
          "type": "string"
        },
        "consent_token": {
          "title": "Consent Token",
          "type": "string"
        },
        "sdk_version": {
          "default": "1.0.0",
          "title": "Sdk Version",
          "type": "string"
        },
        "agent_runtime": {
          "default": "unknown",
          "title": "Agent Runtime",
          "type": "string"
        },
        "client_observed": {
          "anyOf": [
            {
              "$ref": "#/$defs/ClientObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "principal": {
          "anyOf": [
            {
              "$ref": "#/$defs/PrincipalWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "organization": {
          "anyOf": [
            {
              "$ref": "#/$defs/OrganizationWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "labels": {
          "anyOf": [
            {
              "items": {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              },
              "maxItems": 20,
              "minItems": 1,
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Labels"
        },
        "capture": {
          "anyOf": [
            {
              "$ref": "#/$defs/CaptureObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "call_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Call Id"
        },
        "transport_observed": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Transport Observed"
        },
        "session_id_origin": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Session Id Origin"
        },
        "runtime_meta": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Runtime Meta"
        },
        "event_type": {
          "const": "resource_list_end",
          "default": "resource_list_end",
          "title": "Event Type",
          "type": "string"
        },
        "payload": {
          "$ref": "#/$defs/ResourceListEndPayload"
        }
      },
      "required": [
        "tenant_id",
        "vendor_id",
        "session_id",
        "sequence_number",
        "captured_at",
        "consent_token",
        "payload"
      ],
      "title": "ResourceListEndEvent",
      "type": "object"
    },
    "ResourceListEndPayload": {
      "additionalProperties": false,
      "description": "Emitted after ``resources/list`` returns.\n\n\u26a0 ``count`` counts the ``resources`` array ALONE. Resource TEMPLATES are a\nseparate MCP method (``resources/templates/list``) with its own result\narray, and the proxy does not add them in (``proxy.py``'s\n``_emit_call_end``: ``len((result or {}).get(\"resources\", []))``). So a\nserver exposing only templates reports ``count: 0`` here, correctly \u2014 and a\nconsumer must not read this as \"the server has no resources\".",
      "properties": {
        "count": {
          "title": "Count",
          "type": "integer"
        },
        "duration_ms": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Duration Ms"
        }
      },
      "required": [
        "count"
      ],
      "title": "ResourceListEndPayload",
      "type": "object"
    },
    "ResourceListErrorEvent": {
      "additionalProperties": false,
      "properties": {
        "event_id": {
          "format": "uuid",
          "title": "Event Id",
          "type": "string"
        },
        "tenant_id": {
          "title": "Tenant Id",
          "type": "string"
        },
        "vendor_id": {
          "title": "Vendor Id",
          "type": "string"
        },
        "session_id": {
          "title": "Session Id",
          "type": "string"
        },
        "sequence_number": {
          "minimum": 0,
          "title": "Sequence Number",
          "type": "integer"
        },
        "captured_at": {
          "format": "date-time",
          "title": "Captured At",
          "type": "string"
        },
        "consent_token": {
          "title": "Consent Token",
          "type": "string"
        },
        "sdk_version": {
          "default": "1.0.0",
          "title": "Sdk Version",
          "type": "string"
        },
        "agent_runtime": {
          "default": "unknown",
          "title": "Agent Runtime",
          "type": "string"
        },
        "client_observed": {
          "anyOf": [
            {
              "$ref": "#/$defs/ClientObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "principal": {
          "anyOf": [
            {
              "$ref": "#/$defs/PrincipalWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "organization": {
          "anyOf": [
            {
              "$ref": "#/$defs/OrganizationWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "labels": {
          "anyOf": [
            {
              "items": {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              },
              "maxItems": 20,
              "minItems": 1,
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Labels"
        },
        "capture": {
          "anyOf": [
            {
              "$ref": "#/$defs/CaptureObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "call_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Call Id"
        },
        "transport_observed": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Transport Observed"
        },
        "session_id_origin": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Session Id Origin"
        },
        "runtime_meta": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Runtime Meta"
        },
        "event_type": {
          "const": "resource_list_error",
          "default": "resource_list_error",
          "title": "Event Type",
          "type": "string"
        },
        "payload": {
          "$ref": "#/$defs/ResourceListErrorPayload"
        }
      },
      "required": [
        "tenant_id",
        "vendor_id",
        "session_id",
        "sequence_number",
        "captured_at",
        "consent_token",
        "payload"
      ],
      "title": "ResourceListErrorEvent",
      "type": "object"
    },
    "ResourceListErrorPayload": {
      "additionalProperties": false,
      "description": "Emitted when ``resources/list`` failed.\n\n``error_type`` is an UNCONSTRAINED string and the two producers spell it\ndifferently on purpose \u2014 see ``ResourceReadErrorPayload``, which carries\nthe full note for all six error payloads.",
      "properties": {
        "error_type": {
          "title": "Error Type",
          "type": "string"
        },
        "error_body": {
          "title": "Error Body",
          "type": "string"
        },
        "duration_ms": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Duration Ms"
        }
      },
      "required": [
        "error_type",
        "error_body"
      ],
      "title": "ResourceListErrorPayload",
      "type": "object"
    },
    "ResourceListStartEvent": {
      "additionalProperties": false,
      "properties": {
        "event_id": {
          "format": "uuid",
          "title": "Event Id",
          "type": "string"
        },
        "tenant_id": {
          "title": "Tenant Id",
          "type": "string"
        },
        "vendor_id": {
          "title": "Vendor Id",
          "type": "string"
        },
        "session_id": {
          "title": "Session Id",
          "type": "string"
        },
        "sequence_number": {
          "minimum": 0,
          "title": "Sequence Number",
          "type": "integer"
        },
        "captured_at": {
          "format": "date-time",
          "title": "Captured At",
          "type": "string"
        },
        "consent_token": {
          "title": "Consent Token",
          "type": "string"
        },
        "sdk_version": {
          "default": "1.0.0",
          "title": "Sdk Version",
          "type": "string"
        },
        "agent_runtime": {
          "default": "unknown",
          "title": "Agent Runtime",
          "type": "string"
        },
        "client_observed": {
          "anyOf": [
            {
              "$ref": "#/$defs/ClientObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "principal": {
          "anyOf": [
            {
              "$ref": "#/$defs/PrincipalWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "organization": {
          "anyOf": [
            {
              "$ref": "#/$defs/OrganizationWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "labels": {
          "anyOf": [
            {
              "items": {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              },
              "maxItems": 20,
              "minItems": 1,
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Labels"
        },
        "capture": {
          "anyOf": [
            {
              "$ref": "#/$defs/CaptureObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "call_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Call Id"
        },
        "transport_observed": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Transport Observed"
        },
        "session_id_origin": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Session Id Origin"
        },
        "runtime_meta": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Runtime Meta"
        },
        "event_type": {
          "const": "resource_list_start",
          "default": "resource_list_start",
          "title": "Event Type",
          "type": "string"
        },
        "payload": {
          "$ref": "#/$defs/ResourceListStartPayload"
        }
      },
      "required": [
        "tenant_id",
        "vendor_id",
        "session_id",
        "sequence_number",
        "captured_at",
        "consent_token",
        "payload"
      ],
      "title": "ResourceListStartEvent",
      "type": "object"
    },
    "ResourceListStartPayload": {
      "additionalProperties": false,
      "description": "Emitted before a ``resources/list`` reaches the upstream server.\n\nDeliberately EMPTY. A list request carries no subject \u2014 the proxy passes\n``payload={}`` \u2014 and the envelope already names the session, the tenant and\nthe vendor. A consumer counting list traffic has everything it needs\nwithout a member here.",
      "properties": {},
      "title": "ResourceListStartPayload",
      "type": "object"
    },
    "ResourceReadEndEvent": {
      "additionalProperties": false,
      "properties": {
        "event_id": {
          "format": "uuid",
          "title": "Event Id",
          "type": "string"
        },
        "tenant_id": {
          "title": "Tenant Id",
          "type": "string"
        },
        "vendor_id": {
          "title": "Vendor Id",
          "type": "string"
        },
        "session_id": {
          "title": "Session Id",
          "type": "string"
        },
        "sequence_number": {
          "minimum": 0,
          "title": "Sequence Number",
          "type": "integer"
        },
        "captured_at": {
          "format": "date-time",
          "title": "Captured At",
          "type": "string"
        },
        "consent_token": {
          "title": "Consent Token",
          "type": "string"
        },
        "sdk_version": {
          "default": "1.0.0",
          "title": "Sdk Version",
          "type": "string"
        },
        "agent_runtime": {
          "default": "unknown",
          "title": "Agent Runtime",
          "type": "string"
        },
        "client_observed": {
          "anyOf": [
            {
              "$ref": "#/$defs/ClientObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "principal": {
          "anyOf": [
            {
              "$ref": "#/$defs/PrincipalWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "organization": {
          "anyOf": [
            {
              "$ref": "#/$defs/OrganizationWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "labels": {
          "anyOf": [
            {
              "items": {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              },
              "maxItems": 20,
              "minItems": 1,
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Labels"
        },
        "capture": {
          "anyOf": [
            {
              "$ref": "#/$defs/CaptureObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "call_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Call Id"
        },
        "transport_observed": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Transport Observed"
        },
        "session_id_origin": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Session Id Origin"
        },
        "runtime_meta": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Runtime Meta"
        },
        "event_type": {
          "const": "resource_read_end",
          "default": "resource_read_end",
          "title": "Event Type",
          "type": "string"
        },
        "payload": {
          "$ref": "#/$defs/ResourceReadEndPayload"
        }
      },
      "required": [
        "tenant_id",
        "vendor_id",
        "session_id",
        "sequence_number",
        "captured_at",
        "consent_token",
        "payload"
      ],
      "title": "ResourceReadEndEvent",
      "type": "object"
    },
    "ResourceReadEndPayload": {
      "additionalProperties": false,
      "description": "Emitted after ``resources/read`` returns.\n\n\u26a0 **No content member, and that is the design rather than a gap.** The\nresource BODY is customer data of exactly the kind\n``response_capture_switch.md`` exists to keep off the wire, and the only\nproducer there is has never sent it. Recording the URI and the timing is\nwhat makes a failing or slow read visible without the body.",
      "properties": {
        "uri": {
          "title": "Uri",
          "type": "string"
        },
        "duration_ms": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Duration Ms"
        }
      },
      "required": [
        "uri"
      ],
      "title": "ResourceReadEndPayload",
      "type": "object"
    },
    "ResourceReadErrorEvent": {
      "additionalProperties": false,
      "properties": {
        "event_id": {
          "format": "uuid",
          "title": "Event Id",
          "type": "string"
        },
        "tenant_id": {
          "title": "Tenant Id",
          "type": "string"
        },
        "vendor_id": {
          "title": "Vendor Id",
          "type": "string"
        },
        "session_id": {
          "title": "Session Id",
          "type": "string"
        },
        "sequence_number": {
          "minimum": 0,
          "title": "Sequence Number",
          "type": "integer"
        },
        "captured_at": {
          "format": "date-time",
          "title": "Captured At",
          "type": "string"
        },
        "consent_token": {
          "title": "Consent Token",
          "type": "string"
        },
        "sdk_version": {
          "default": "1.0.0",
          "title": "Sdk Version",
          "type": "string"
        },
        "agent_runtime": {
          "default": "unknown",
          "title": "Agent Runtime",
          "type": "string"
        },
        "client_observed": {
          "anyOf": [
            {
              "$ref": "#/$defs/ClientObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "principal": {
          "anyOf": [
            {
              "$ref": "#/$defs/PrincipalWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "organization": {
          "anyOf": [
            {
              "$ref": "#/$defs/OrganizationWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "labels": {
          "anyOf": [
            {
              "items": {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              },
              "maxItems": 20,
              "minItems": 1,
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Labels"
        },
        "capture": {
          "anyOf": [
            {
              "$ref": "#/$defs/CaptureObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "call_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Call Id"
        },
        "transport_observed": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Transport Observed"
        },
        "session_id_origin": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Session Id Origin"
        },
        "runtime_meta": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Runtime Meta"
        },
        "event_type": {
          "const": "resource_read_error",
          "default": "resource_read_error",
          "title": "Event Type",
          "type": "string"
        },
        "payload": {
          "$ref": "#/$defs/ResourceReadErrorPayload"
        }
      },
      "required": [
        "tenant_id",
        "vendor_id",
        "session_id",
        "sequence_number",
        "captured_at",
        "consent_token",
        "payload"
      ],
      "title": "ResourceReadErrorEvent",
      "type": "object"
    },
    "ResourceReadErrorPayload": {
      "additionalProperties": false,
      "description": "Emitted when ``resources/read`` failed.\n\n\u26a0 **``error_type`` is an unconstrained string and the producers do NOT\nagree on how to spell it** \u2014 stated here, for all six error payloads,\nrather than left for a consumer to discover. ``baton-proxy`` reads the\nWIRE, so what it holds is the upstream's JSON-RPC error and it files the\nnumeric ``code`` as a string (``\"-32002\"``). An in-process SDK sensor holds\na live exception instead and files its class name, the way \u00a711.4.3's RAISE\nshape already does for tools. Both are legal \u2014 the schema constrains\nneither, and \u00a711.4.3 says outright that this member separates SHAPES and is\nnot a closed set of values \u2014 but a consumer MUST NOT read one producer's\nspelling as the vocabulary.\n\n\u26a0 **``error_body`` is KEPT whatever the capture mode.** It is a failed\nFETCH's message, not anything a resource returned, so nothing here is\nresult-derived. \u00a711.4.3's provenance rule put the proxy's own\nupstream-error analogue on the same footing.",
      "properties": {
        "uri": {
          "title": "Uri",
          "type": "string"
        },
        "error_type": {
          "title": "Error Type",
          "type": "string"
        },
        "error_body": {
          "title": "Error Body",
          "type": "string"
        },
        "duration_ms": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Duration Ms"
        }
      },
      "required": [
        "uri",
        "error_type",
        "error_body"
      ],
      "title": "ResourceReadErrorPayload",
      "type": "object"
    },
    "ResourceReadStartEvent": {
      "additionalProperties": false,
      "properties": {
        "event_id": {
          "format": "uuid",
          "title": "Event Id",
          "type": "string"
        },
        "tenant_id": {
          "title": "Tenant Id",
          "type": "string"
        },
        "vendor_id": {
          "title": "Vendor Id",
          "type": "string"
        },
        "session_id": {
          "title": "Session Id",
          "type": "string"
        },
        "sequence_number": {
          "minimum": 0,
          "title": "Sequence Number",
          "type": "integer"
        },
        "captured_at": {
          "format": "date-time",
          "title": "Captured At",
          "type": "string"
        },
        "consent_token": {
          "title": "Consent Token",
          "type": "string"
        },
        "sdk_version": {
          "default": "1.0.0",
          "title": "Sdk Version",
          "type": "string"
        },
        "agent_runtime": {
          "default": "unknown",
          "title": "Agent Runtime",
          "type": "string"
        },
        "client_observed": {
          "anyOf": [
            {
              "$ref": "#/$defs/ClientObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "principal": {
          "anyOf": [
            {
              "$ref": "#/$defs/PrincipalWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "organization": {
          "anyOf": [
            {
              "$ref": "#/$defs/OrganizationWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "labels": {
          "anyOf": [
            {
              "items": {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              },
              "maxItems": 20,
              "minItems": 1,
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Labels"
        },
        "capture": {
          "anyOf": [
            {
              "$ref": "#/$defs/CaptureObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "call_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Call Id"
        },
        "transport_observed": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Transport Observed"
        },
        "session_id_origin": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Session Id Origin"
        },
        "runtime_meta": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Runtime Meta"
        },
        "event_type": {
          "const": "resource_read_start",
          "default": "resource_read_start",
          "title": "Event Type",
          "type": "string"
        },
        "payload": {
          "$ref": "#/$defs/ResourceReadStartPayload"
        }
      },
      "required": [
        "tenant_id",
        "vendor_id",
        "session_id",
        "sequence_number",
        "captured_at",
        "consent_token",
        "payload"
      ],
      "title": "ResourceReadStartEvent",
      "type": "object"
    },
    "ResourceReadStartPayload": {
      "additionalProperties": false,
      "description": "Emitted before a ``resources/read`` reaches the upstream server.\n\n\u26a0 ``uri`` is ALSO inside ``params``. The proxy builds ``params`` by\nremoving ``_meta`` from the request's params and nothing else\n(``proxy.py``: ``{k: v for k, v in params.items() if k != \"_meta\"}``), and\n``uri`` is one of them \u2014 so the subject appears twice, once in its own\nmember and once in the bag. Recorded rather than deduplicated: the\ndedicated member is what a consumer should read, the bag is what the caller\nactually sent, and a producer that stripped ``uri`` from ``params`` would\nstop being able to say that.",
      "properties": {
        "uri": {
          "title": "Uri",
          "type": "string"
        },
        "params": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Params"
        }
      },
      "required": [
        "uri"
      ],
      "title": "ResourceReadStartPayload",
      "type": "object"
    },
    "SurfaceSnapshotEvent": {
      "additionalProperties": false,
      "properties": {
        "event_id": {
          "format": "uuid",
          "title": "Event Id",
          "type": "string"
        },
        "tenant_id": {
          "title": "Tenant Id",
          "type": "string"
        },
        "vendor_id": {
          "title": "Vendor Id",
          "type": "string"
        },
        "session_id": {
          "title": "Session Id",
          "type": "string"
        },
        "sequence_number": {
          "minimum": 0,
          "title": "Sequence Number",
          "type": "integer"
        },
        "captured_at": {
          "format": "date-time",
          "title": "Captured At",
          "type": "string"
        },
        "consent_token": {
          "title": "Consent Token",
          "type": "string"
        },
        "sdk_version": {
          "default": "1.0.0",
          "title": "Sdk Version",
          "type": "string"
        },
        "agent_runtime": {
          "default": "unknown",
          "title": "Agent Runtime",
          "type": "string"
        },
        "client_observed": {
          "anyOf": [
            {
              "$ref": "#/$defs/ClientObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "principal": {
          "anyOf": [
            {
              "$ref": "#/$defs/PrincipalWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "organization": {
          "anyOf": [
            {
              "$ref": "#/$defs/OrganizationWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "labels": {
          "anyOf": [
            {
              "items": {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              },
              "maxItems": 20,
              "minItems": 1,
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Labels"
        },
        "capture": {
          "anyOf": [
            {
              "$ref": "#/$defs/CaptureObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "call_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Call Id"
        },
        "transport_observed": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Transport Observed"
        },
        "session_id_origin": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Session Id Origin"
        },
        "runtime_meta": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Runtime Meta"
        },
        "event_type": {
          "const": "surface_snapshot",
          "default": "surface_snapshot",
          "title": "Event Type",
          "type": "string"
        },
        "payload": {
          "$ref": "#/$defs/SurfaceSnapshotPayload"
        }
      },
      "required": [
        "tenant_id",
        "vendor_id",
        "session_id",
        "sequence_number",
        "captured_at",
        "consent_token",
        "payload"
      ],
      "title": "SurfaceSnapshotEvent",
      "type": "object"
    },
    "SurfaceSnapshotPayload": {
      "additionalProperties": false,
      "description": "The vendor-true upstream surface (pre-injection) \u2014 mirrors baton-proxy's\n``enqueue_surface_snapshot`` payload's top-level fields (see\n``baton_proxy.emitter.Emitter.enqueue_surface_snapshot``) so the Console\nworker materializes both into the same ``vendor_surfaces`` table. Emitted\nat most once per observed ``surface_hash`` per process by an adapter, and\nper client by the library's ``list_tools``.\n\n``tools`` excludes Baton's own injected tool(s) (e.g. the annotation\ntool) \u2014 those are recorded in ``seam_augmentations.injected_tools``\ninstead, matching proxy's split. ``surface_hash`` is the identity change\nspecs are authored against (proxy's ``base_surface_hash``); it must NOT\ninclude anything Baton adds, or toggling e.g. ``intent_param_mode`` would\ninvalidate every recipe pinned to the vendor's real surface.\n\n``seam_augmentations.intent_param`` carries plural ``names: list[str]``,\nnow ``[\"user_goal\"]``. Older events still carry the shapes this field has\nhad before (two or three names, or proxy's original singular\n``name: str``), so a consumer building a surface view MUST read every\nshape, not just the current one. The list is DATA, not shape: it must\nnever feed ``surface_hash``, or adding a param would invalidate every\nrecipe pinned to the vendor's real surface.\n\n``seam_augmentations.intent_param.required_names: list[str]`` is which of\n``names`` the producer advertised as required. Not every producer or older\nevent carries it, so a consumer MUST read a missing ``required_names`` as\nunknown, never as an empty list.",
      "properties": {
        "surface_hash": {
          "title": "Surface Hash",
          "type": "string"
        },
        "server_info": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Server Info"
        },
        "capabilities": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Capabilities"
        },
        "instructions": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Instructions"
        },
        "tools": {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "title": "Tools",
          "type": "array"
        },
        "seam_augmentations": {
          "additionalProperties": true,
          "title": "Seam Augmentations",
          "type": "object"
        }
      },
      "required": [
        "surface_hash"
      ],
      "title": "SurfaceSnapshotPayload",
      "type": "object"
    },
    "ToolCallEndEvent": {
      "additionalProperties": false,
      "properties": {
        "event_id": {
          "format": "uuid",
          "title": "Event Id",
          "type": "string"
        },
        "tenant_id": {
          "title": "Tenant Id",
          "type": "string"
        },
        "vendor_id": {
          "title": "Vendor Id",
          "type": "string"
        },
        "session_id": {
          "title": "Session Id",
          "type": "string"
        },
        "sequence_number": {
          "minimum": 0,
          "title": "Sequence Number",
          "type": "integer"
        },
        "captured_at": {
          "format": "date-time",
          "title": "Captured At",
          "type": "string"
        },
        "consent_token": {
          "title": "Consent Token",
          "type": "string"
        },
        "sdk_version": {
          "default": "1.0.0",
          "title": "Sdk Version",
          "type": "string"
        },
        "agent_runtime": {
          "default": "unknown",
          "title": "Agent Runtime",
          "type": "string"
        },
        "client_observed": {
          "anyOf": [
            {
              "$ref": "#/$defs/ClientObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "principal": {
          "anyOf": [
            {
              "$ref": "#/$defs/PrincipalWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "organization": {
          "anyOf": [
            {
              "$ref": "#/$defs/OrganizationWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "labels": {
          "anyOf": [
            {
              "items": {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              },
              "maxItems": 20,
              "minItems": 1,
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Labels"
        },
        "capture": {
          "anyOf": [
            {
              "$ref": "#/$defs/CaptureObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "call_id": {
          "minLength": 1,
          "title": "Call Id",
          "type": "string"
        },
        "transport_observed": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Transport Observed"
        },
        "session_id_origin": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Session Id Origin"
        },
        "runtime_meta": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Runtime Meta"
        },
        "event_type": {
          "const": "tool_call_end",
          "default": "tool_call_end",
          "title": "Event Type",
          "type": "string"
        },
        "payload": {
          "$ref": "#/$defs/ToolCallEndPayload"
        }
      },
      "required": [
        "tenant_id",
        "vendor_id",
        "session_id",
        "sequence_number",
        "captured_at",
        "consent_token",
        "call_id",
        "payload"
      ],
      "title": "ToolCallEndEvent",
      "type": "object"
    },
    "ToolCallEndPayload": {
      "additionalProperties": false,
      "description": "Emitted after the vendor handler returns. ``result`` is PII-scrubbed.",
      "properties": {
        "tool_name": {
          "title": "Tool Name",
          "type": "string"
        },
        "result": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Result"
        },
        "duration_ms": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Duration Ms"
        },
        "result_capture": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Result Capture"
        }
      },
      "required": [
        "tool_name"
      ],
      "title": "ToolCallEndPayload",
      "type": "object"
    },
    "ToolCallErrorEvent": {
      "additionalProperties": false,
      "properties": {
        "event_id": {
          "format": "uuid",
          "title": "Event Id",
          "type": "string"
        },
        "tenant_id": {
          "title": "Tenant Id",
          "type": "string"
        },
        "vendor_id": {
          "title": "Vendor Id",
          "type": "string"
        },
        "session_id": {
          "title": "Session Id",
          "type": "string"
        },
        "sequence_number": {
          "minimum": 0,
          "title": "Sequence Number",
          "type": "integer"
        },
        "captured_at": {
          "format": "date-time",
          "title": "Captured At",
          "type": "string"
        },
        "consent_token": {
          "title": "Consent Token",
          "type": "string"
        },
        "sdk_version": {
          "default": "1.0.0",
          "title": "Sdk Version",
          "type": "string"
        },
        "agent_runtime": {
          "default": "unknown",
          "title": "Agent Runtime",
          "type": "string"
        },
        "client_observed": {
          "anyOf": [
            {
              "$ref": "#/$defs/ClientObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "principal": {
          "anyOf": [
            {
              "$ref": "#/$defs/PrincipalWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "organization": {
          "anyOf": [
            {
              "$ref": "#/$defs/OrganizationWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "labels": {
          "anyOf": [
            {
              "items": {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              },
              "maxItems": 20,
              "minItems": 1,
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Labels"
        },
        "capture": {
          "anyOf": [
            {
              "$ref": "#/$defs/CaptureObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "call_id": {
          "minLength": 1,
          "title": "Call Id",
          "type": "string"
        },
        "transport_observed": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Transport Observed"
        },
        "session_id_origin": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Session Id Origin"
        },
        "runtime_meta": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Runtime Meta"
        },
        "event_type": {
          "const": "tool_call_error",
          "default": "tool_call_error",
          "title": "Event Type",
          "type": "string"
        },
        "payload": {
          "$ref": "#/$defs/ToolCallErrorPayload"
        }
      },
      "required": [
        "tenant_id",
        "vendor_id",
        "session_id",
        "sequence_number",
        "captured_at",
        "consent_token",
        "call_id",
        "payload"
      ],
      "title": "ToolCallErrorEvent",
      "type": "object"
    },
    "ToolCallErrorPayload": {
      "additionalProperties": false,
      "description": "Emitted when the call FAILED, which MCP expresses two ways (SPEC \u00a711.4.3).\n\n**RAISE** \u2014 the vendor handler raised. ``error_type`` is the exception class\nname, ``error_body`` its message (PII-scrubbed), and ``result`` is None:\nthere is no result object to record.\n\n**RETURN** \u2014 the handler returned normally and the result carried MCP's\nerror flag, which rides a 200 response rather than a JSON-RPC error.\n``error_type`` is ``\"tool_error\"``, ``error_body`` is the reason unwrapped\nfrom the result's ``content`` text parts, and ``result`` carries the full\nenvelope, PII-scrubbed and NOT unwrapped the way ``tool_call_end.result``\nunwraps to the developer's return \u2014 the envelope is what holds the flag and\nthe reason.\n\n``result`` exists so reclassifying the RETURN shape off ``tool_call_end``\ndoes not move a structured body into a flat truncated string.",
      "properties": {
        "tool_name": {
          "title": "Tool Name",
          "type": "string"
        },
        "error_type": {
          "title": "Error Type",
          "type": "string"
        },
        "error_body": {
          "title": "Error Body",
          "type": "string"
        },
        "duration_ms": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Duration Ms"
        },
        "result": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Result"
        },
        "result_capture": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Result Capture"
        },
        "failure_kind": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Failure Kind"
        }
      },
      "required": [
        "tool_name",
        "error_type",
        "error_body"
      ],
      "title": "ToolCallErrorPayload",
      "type": "object"
    },
    "ToolCallStartEvent": {
      "additionalProperties": false,
      "properties": {
        "event_id": {
          "format": "uuid",
          "title": "Event Id",
          "type": "string"
        },
        "tenant_id": {
          "title": "Tenant Id",
          "type": "string"
        },
        "vendor_id": {
          "title": "Vendor Id",
          "type": "string"
        },
        "session_id": {
          "title": "Session Id",
          "type": "string"
        },
        "sequence_number": {
          "minimum": 0,
          "title": "Sequence Number",
          "type": "integer"
        },
        "captured_at": {
          "format": "date-time",
          "title": "Captured At",
          "type": "string"
        },
        "consent_token": {
          "title": "Consent Token",
          "type": "string"
        },
        "sdk_version": {
          "default": "1.0.0",
          "title": "Sdk Version",
          "type": "string"
        },
        "agent_runtime": {
          "default": "unknown",
          "title": "Agent Runtime",
          "type": "string"
        },
        "client_observed": {
          "anyOf": [
            {
              "$ref": "#/$defs/ClientObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "principal": {
          "anyOf": [
            {
              "$ref": "#/$defs/PrincipalWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "organization": {
          "anyOf": [
            {
              "$ref": "#/$defs/OrganizationWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "labels": {
          "anyOf": [
            {
              "items": {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              },
              "maxItems": 20,
              "minItems": 1,
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Labels"
        },
        "capture": {
          "anyOf": [
            {
              "$ref": "#/$defs/CaptureObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "call_id": {
          "minLength": 1,
          "title": "Call Id",
          "type": "string"
        },
        "transport_observed": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Transport Observed"
        },
        "session_id_origin": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Session Id Origin"
        },
        "runtime_meta": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Runtime Meta"
        },
        "event_type": {
          "const": "tool_call_start",
          "default": "tool_call_start",
          "title": "Event Type",
          "type": "string"
        },
        "payload": {
          "$ref": "#/$defs/ToolCallStartPayload"
        }
      },
      "required": [
        "tenant_id",
        "vendor_id",
        "session_id",
        "sequence_number",
        "captured_at",
        "consent_token",
        "call_id",
        "payload"
      ],
      "title": "ToolCallStartEvent",
      "type": "object"
    },
    "ToolCallStartPayload": {
      "additionalProperties": false,
      "description": "Emitted before the vendor handler runs. ``params`` is PII-scrubbed at\nemit-time per SPEC \u00a77.\n\n``call_intent`` is the value the SDK stripped from the injected\n``user_goal`` param (``integrations._llm_text``), or, on the library API,\nwhat the vendor passed to ``trace()`` (SPEC \u00a75.6). It rides as a SIBLING\nof ``params``, which stays exactly the vendor-visible arguments.\n``call_expected`` / ``call_workflow`` come from the library API, from\nolder producers that injected ``expected_result`` / ``overall_task``, and\nfrom a client that still sends those names from an old tool list.\n``intent_source`` records provenance (``\"injected_param\"`` or\n``\"library_arg\"``). All null when no intent was given.",
      "properties": {
        "tool_name": {
          "title": "Tool Name",
          "type": "string"
        },
        "params": {
          "additionalProperties": true,
          "title": "Params",
          "type": "object"
        },
        "call_intent": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Call Intent"
        },
        "call_expected": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Call Expected"
        },
        "call_workflow": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Call Workflow"
        },
        "intent_source": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Intent Source"
        }
      },
      "required": [
        "tool_name"
      ],
      "title": "ToolCallStartPayload",
      "type": "object"
    },
    "ToolListEndEvent": {
      "additionalProperties": false,
      "properties": {
        "event_id": {
          "format": "uuid",
          "title": "Event Id",
          "type": "string"
        },
        "tenant_id": {
          "title": "Tenant Id",
          "type": "string"
        },
        "vendor_id": {
          "title": "Vendor Id",
          "type": "string"
        },
        "session_id": {
          "title": "Session Id",
          "type": "string"
        },
        "sequence_number": {
          "minimum": 0,
          "title": "Sequence Number",
          "type": "integer"
        },
        "captured_at": {
          "format": "date-time",
          "title": "Captured At",
          "type": "string"
        },
        "consent_token": {
          "title": "Consent Token",
          "type": "string"
        },
        "sdk_version": {
          "default": "1.0.0",
          "title": "Sdk Version",
          "type": "string"
        },
        "agent_runtime": {
          "default": "unknown",
          "title": "Agent Runtime",
          "type": "string"
        },
        "client_observed": {
          "anyOf": [
            {
              "$ref": "#/$defs/ClientObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "principal": {
          "anyOf": [
            {
              "$ref": "#/$defs/PrincipalWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "organization": {
          "anyOf": [
            {
              "$ref": "#/$defs/OrganizationWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "labels": {
          "anyOf": [
            {
              "items": {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              },
              "maxItems": 20,
              "minItems": 1,
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Labels"
        },
        "capture": {
          "anyOf": [
            {
              "$ref": "#/$defs/CaptureObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "call_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Call Id"
        },
        "transport_observed": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Transport Observed"
        },
        "session_id_origin": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Session Id Origin"
        },
        "runtime_meta": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Runtime Meta"
        },
        "event_type": {
          "const": "tool_list_end",
          "default": "tool_list_end",
          "title": "Event Type",
          "type": "string"
        },
        "payload": {
          "$ref": "#/$defs/ToolListEndPayload"
        }
      },
      "required": [
        "tenant_id",
        "vendor_id",
        "session_id",
        "sequence_number",
        "captured_at",
        "consent_token",
        "payload"
      ],
      "title": "ToolListEndEvent",
      "type": "object"
    },
    "ToolListEndPayload": {
      "additionalProperties": false,
      "description": "Emitted after ``tools/list`` returns. ``count`` is the length of the\n``tools`` array in that one response, the producer's own tools included.",
      "properties": {
        "count": {
          "title": "Count",
          "type": "integer"
        },
        "duration_ms": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Duration Ms"
        }
      },
      "required": [
        "count"
      ],
      "title": "ToolListEndPayload",
      "type": "object"
    },
    "ToolListErrorEvent": {
      "additionalProperties": false,
      "properties": {
        "event_id": {
          "format": "uuid",
          "title": "Event Id",
          "type": "string"
        },
        "tenant_id": {
          "title": "Tenant Id",
          "type": "string"
        },
        "vendor_id": {
          "title": "Vendor Id",
          "type": "string"
        },
        "session_id": {
          "title": "Session Id",
          "type": "string"
        },
        "sequence_number": {
          "minimum": 0,
          "title": "Sequence Number",
          "type": "integer"
        },
        "captured_at": {
          "format": "date-time",
          "title": "Captured At",
          "type": "string"
        },
        "consent_token": {
          "title": "Consent Token",
          "type": "string"
        },
        "sdk_version": {
          "default": "1.0.0",
          "title": "Sdk Version",
          "type": "string"
        },
        "agent_runtime": {
          "default": "unknown",
          "title": "Agent Runtime",
          "type": "string"
        },
        "client_observed": {
          "anyOf": [
            {
              "$ref": "#/$defs/ClientObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "principal": {
          "anyOf": [
            {
              "$ref": "#/$defs/PrincipalWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "organization": {
          "anyOf": [
            {
              "$ref": "#/$defs/OrganizationWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "labels": {
          "anyOf": [
            {
              "items": {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              },
              "maxItems": 20,
              "minItems": 1,
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Labels"
        },
        "capture": {
          "anyOf": [
            {
              "$ref": "#/$defs/CaptureObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "call_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Call Id"
        },
        "transport_observed": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Transport Observed"
        },
        "session_id_origin": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Session Id Origin"
        },
        "runtime_meta": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Runtime Meta"
        },
        "event_type": {
          "const": "tool_list_error",
          "default": "tool_list_error",
          "title": "Event Type",
          "type": "string"
        },
        "payload": {
          "$ref": "#/$defs/ToolListErrorPayload"
        }
      },
      "required": [
        "tenant_id",
        "vendor_id",
        "session_id",
        "sequence_number",
        "captured_at",
        "consent_token",
        "payload"
      ],
      "title": "ToolListErrorEvent",
      "type": "object"
    },
    "ToolListErrorPayload": {
      "additionalProperties": false,
      "description": "Emitted when ``tools/list`` failed. See\n``ResourceReadErrorPayload`` for how ``error_type`` is spelled.",
      "properties": {
        "error_type": {
          "title": "Error Type",
          "type": "string"
        },
        "error_body": {
          "title": "Error Body",
          "type": "string"
        },
        "duration_ms": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Duration Ms"
        }
      },
      "required": [
        "error_type",
        "error_body"
      ],
      "title": "ToolListErrorPayload",
      "type": "object"
    },
    "ToolListStartEvent": {
      "additionalProperties": false,
      "properties": {
        "event_id": {
          "format": "uuid",
          "title": "Event Id",
          "type": "string"
        },
        "tenant_id": {
          "title": "Tenant Id",
          "type": "string"
        },
        "vendor_id": {
          "title": "Vendor Id",
          "type": "string"
        },
        "session_id": {
          "title": "Session Id",
          "type": "string"
        },
        "sequence_number": {
          "minimum": 0,
          "title": "Sequence Number",
          "type": "integer"
        },
        "captured_at": {
          "format": "date-time",
          "title": "Captured At",
          "type": "string"
        },
        "consent_token": {
          "title": "Consent Token",
          "type": "string"
        },
        "sdk_version": {
          "default": "1.0.0",
          "title": "Sdk Version",
          "type": "string"
        },
        "agent_runtime": {
          "default": "unknown",
          "title": "Agent Runtime",
          "type": "string"
        },
        "client_observed": {
          "anyOf": [
            {
              "$ref": "#/$defs/ClientObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "principal": {
          "anyOf": [
            {
              "$ref": "#/$defs/PrincipalWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "organization": {
          "anyOf": [
            {
              "$ref": "#/$defs/OrganizationWire"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "labels": {
          "anyOf": [
            {
              "items": {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              },
              "maxItems": 20,
              "minItems": 1,
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Labels"
        },
        "capture": {
          "anyOf": [
            {
              "$ref": "#/$defs/CaptureObserved"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "call_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Call Id"
        },
        "transport_observed": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Transport Observed"
        },
        "session_id_origin": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Session Id Origin"
        },
        "runtime_meta": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Runtime Meta"
        },
        "event_type": {
          "const": "tool_list_start",
          "default": "tool_list_start",
          "title": "Event Type",
          "type": "string"
        },
        "payload": {
          "$ref": "#/$defs/ToolListStartPayload"
        }
      },
      "required": [
        "tenant_id",
        "vendor_id",
        "session_id",
        "sequence_number",
        "captured_at",
        "consent_token",
        "payload"
      ],
      "title": "ToolListStartEvent",
      "type": "object"
    },
    "ToolListStartPayload": {
      "additionalProperties": false,
      "description": "Emitted before a ``tools/list`` request is served (SPEC \u00a711.4.5). Empty,\nfor the reason ``ResourceListStartPayload`` carries.",
      "properties": {},
      "title": "ToolListStartPayload",
      "type": "object"
    }
  },
  "discriminator": {
    "mapping": {
      "annotation": "#/$defs/AnnotationEvent",
      "client_report": "#/$defs/ClientReportEvent",
      "prompt_get_end": "#/$defs/PromptGetEndEvent",
      "prompt_get_error": "#/$defs/PromptGetErrorEvent",
      "prompt_get_start": "#/$defs/PromptGetStartEvent",
      "prompt_list_end": "#/$defs/PromptListEndEvent",
      "prompt_list_error": "#/$defs/PromptListErrorEvent",
      "prompt_list_start": "#/$defs/PromptListStartEvent",
      "resource_list_end": "#/$defs/ResourceListEndEvent",
      "resource_list_error": "#/$defs/ResourceListErrorEvent",
      "resource_list_start": "#/$defs/ResourceListStartEvent",
      "resource_read_end": "#/$defs/ResourceReadEndEvent",
      "resource_read_error": "#/$defs/ResourceReadErrorEvent",
      "resource_read_start": "#/$defs/ResourceReadStartEvent",
      "surface_snapshot": "#/$defs/SurfaceSnapshotEvent",
      "tool_call_end": "#/$defs/ToolCallEndEvent",
      "tool_call_error": "#/$defs/ToolCallErrorEvent",
      "tool_call_start": "#/$defs/ToolCallStartEvent",
      "tool_list_end": "#/$defs/ToolListEndEvent",
      "tool_list_error": "#/$defs/ToolListErrorEvent",
      "tool_list_start": "#/$defs/ToolListStartEvent"
    },
    "propertyName": "event_type"
  },
  "oneOf": [
    {
      "$ref": "#/$defs/ToolCallStartEvent"
    },
    {
      "$ref": "#/$defs/ToolCallEndEvent"
    },
    {
      "$ref": "#/$defs/ToolCallErrorEvent"
    },
    {
      "$ref": "#/$defs/AnnotationEvent"
    },
    {
      "$ref": "#/$defs/SurfaceSnapshotEvent"
    },
    {
      "$ref": "#/$defs/ClientReportEvent"
    },
    {
      "$ref": "#/$defs/ResourceListStartEvent"
    },
    {
      "$ref": "#/$defs/ResourceListEndEvent"
    },
    {
      "$ref": "#/$defs/ResourceListErrorEvent"
    },
    {
      "$ref": "#/$defs/ResourceReadStartEvent"
    },
    {
      "$ref": "#/$defs/ResourceReadEndEvent"
    },
    {
      "$ref": "#/$defs/ResourceReadErrorEvent"
    },
    {
      "$ref": "#/$defs/PromptListStartEvent"
    },
    {
      "$ref": "#/$defs/PromptListEndEvent"
    },
    {
      "$ref": "#/$defs/PromptListErrorEvent"
    },
    {
      "$ref": "#/$defs/PromptGetStartEvent"
    },
    {
      "$ref": "#/$defs/PromptGetEndEvent"
    },
    {
      "$ref": "#/$defs/PromptGetErrorEvent"
    },
    {
      "$ref": "#/$defs/ToolListStartEvent"
    },
    {
      "$ref": "#/$defs/ToolListEndEvent"
    },
    {
      "$ref": "#/$defs/ToolListErrorEvent"
    }
  ]
}
