{
  "contractVersion": "2.1.0",
  "schemas": {
    "chat_request": {
      "type": "object",
      "required": [
        "type",
        "id",
        "text",
        "context",
        "mode",
        "tabId",
        "sessionKey"
      ],
      "properties": {
        "type": {
          "const": "chat_request",
          "type": "string"
        },
        "id": {
          "pattern": "^c-",
          "type": "string"
        },
        "text": {
          "type": "string"
        },
        "context": {
          "anyOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "required": [
                "v",
                "capturedAt",
                "tabId",
                "url",
                "path",
                "title",
                "ax",
                "api",
                "truncated"
              ],
              "properties": {
                "v": {
                  "const": 1,
                  "type": "number"
                },
                "capturedAt": {
                  "type": "number"
                },
                "tabId": {
                  "type": "number"
                },
                "url": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "ax": {
                  "anyOf": [
                    {
                      "type": "null"
                    },
                    {
                      "additionalProperties": true,
                      "type": "object",
                      "required": [
                        "role"
                      ],
                      "properties": {
                        "role": {
                          "type": "string"
                        }
                      }
                    }
                  ]
                },
                "api": {
                  "anyOf": [
                    {
                      "type": "null"
                    },
                    {
                      "type": "object",
                      "required": [
                        "url",
                        "status",
                        "resourceType",
                        "body",
                        "truncated"
                      ],
                      "properties": {
                        "url": {
                          "type": "string"
                        },
                        "status": {
                          "type": "number"
                        },
                        "resourceType": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "body": {},
                        "truncated": {
                          "type": "boolean"
                        }
                      }
                    }
                  ]
                },
                "truncated": {
                  "type": "boolean"
                }
              }
            }
          ]
        },
        "mode": {
          "anyOf": [
            {
              "const": "educational",
              "type": "string"
            },
            {
              "const": "presentation",
              "type": "string"
            },
            {
              "const": "configuration",
              "type": "string"
            },
            {
              "const": "screenshot",
              "type": "string"
            },
            {
              "const": "annotation",
              "type": "string"
            }
          ]
        },
        "tabId": {
          "type": "number"
        },
        "sessionKey": {
          "minLength": 1,
          "type": "string"
        },
        "history_hint": {
          "type": "string"
        }
      }
    },
    "chat_stop": {
      "type": "object",
      "required": [
        "type",
        "id"
      ],
      "properties": {
        "type": {
          "const": "chat_stop",
          "type": "string"
        },
        "id": {
          "pattern": "^c-",
          "type": "string"
        }
      }
    },
    "chat_delta": {
      "type": "object",
      "required": [
        "type",
        "id",
        "seq",
        "delta"
      ],
      "properties": {
        "type": {
          "const": "chat_delta",
          "type": "string"
        },
        "id": {
          "pattern": "^c-",
          "type": "string"
        },
        "seq": {
          "type": "number"
        },
        "delta": {
          "type": "string"
        }
      }
    },
    "chat_done": {
      "type": "object",
      "required": [
        "type",
        "id"
      ],
      "properties": {
        "type": {
          "const": "chat_done",
          "type": "string"
        },
        "id": {
          "pattern": "^c-",
          "type": "string"
        },
        "references": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "kind",
              "title",
              "url"
            ],
            "properties": {
              "kind": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "url": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "chat_error": {
      "type": "object",
      "required": [
        "type",
        "id",
        "reason"
      ],
      "properties": {
        "type": {
          "const": "chat_error",
          "type": "string"
        },
        "id": {
          "pattern": "^c-",
          "type": "string"
        },
        "reason": {
          "anyOf": [
            {
              "const": "bridge-disconnected",
              "type": "string"
            },
            {
              "const": "bridge-unresponsive",
              "type": "string"
            },
            {
              "const": "no-worker",
              "type": "string"
            },
            {
              "const": "session-busy",
              "type": "string"
            },
            {
              "const": "session-disposed",
              "type": "string"
            },
            {
              "const": "token-expired",
              "type": "string"
            },
            {
              "const": "token-expiring",
              "type": "string"
            },
            {
              "const": "provider-auth",
              "type": "string"
            },
            {
              "const": "provider-4xx",
              "type": "string"
            },
            {
              "const": "provider-5xx",
              "type": "string"
            }
          ]
        }
      }
    },
    "chat_tool_notice": {
      "type": "object",
      "required": [
        "type",
        "id",
        "tool",
        "ok"
      ],
      "properties": {
        "type": {
          "const": "chat_tool_notice",
          "type": "string"
        },
        "id": {
          "pattern": "^c-",
          "type": "string"
        },
        "tool": {
          "type": "string"
        },
        "ok": {
          "type": "boolean"
        },
        "detail": {
          "type": "string"
        }
      }
    },
    "chat_keepalive": {
      "type": "object",
      "required": [
        "type",
        "id"
      ],
      "properties": {
        "type": {
          "const": "chat_keepalive",
          "type": "string"
        },
        "id": {
          "pattern": "^c-",
          "type": "string"
        }
      }
    },
    "set_host_tools": {
      "type": "object",
      "required": [
        "type",
        "tools"
      ],
      "properties": {
        "type": {
          "const": "set_host_tools",
          "type": "string"
        },
        "tools": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "name",
              "description",
              "parameters"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "label": {
                "type": "string"
              },
              "description": {
                "type": "string"
              },
              "parameters": {
                "type": "object",
                "patternProperties": {
                  "^(.*)$": {}
                }
              },
              "hidden": {
                "type": "boolean"
              }
            }
          }
        }
      }
    },
    "set_host_tools_ack": {
      "type": "object",
      "required": [
        "type",
        "toolNames"
      ],
      "properties": {
        "type": {
          "const": "set_host_tools_ack",
          "type": "string"
        },
        "toolNames": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "set_host_tools_error": {
      "type": "object",
      "required": [
        "type",
        "reason"
      ],
      "properties": {
        "type": {
          "const": "set_host_tools_error",
          "type": "string"
        },
        "reason": {
          "const": "host-tools-rejected",
          "type": "string"
        }
      }
    },
    "host_tool_call": {
      "type": "object",
      "required": [
        "type",
        "id",
        "toolCallId",
        "toolName",
        "arguments"
      ],
      "properties": {
        "type": {
          "const": "host_tool_call",
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "toolCallId": {
          "type": "string"
        },
        "toolName": {
          "type": "string"
        },
        "arguments": {
          "type": "object",
          "patternProperties": {
            "^(.*)$": {}
          }
        }
      }
    },
    "host_tool_update": {
      "type": "object",
      "required": [
        "type",
        "id",
        "partialResult"
      ],
      "properties": {
        "type": {
          "const": "host_tool_update",
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "partialResult": {
          "type": "object",
          "required": [
            "content"
          ],
          "properties": {
            "content": {
              "type": "array",
              "items": {
                "additionalProperties": true,
                "type": "object",
                "required": [
                  "type"
                ],
                "properties": {
                  "type": {
                    "type": "string"
                  }
                }
              }
            },
            "details": {
              "type": "object",
              "patternProperties": {
                "^(.*)$": {}
              }
            }
          }
        }
      }
    },
    "host_tool_result": {
      "type": "object",
      "required": [
        "type",
        "id",
        "result"
      ],
      "properties": {
        "type": {
          "const": "host_tool_result",
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "result": {
          "type": "object",
          "required": [
            "content"
          ],
          "properties": {
            "content": {
              "type": "array",
              "items": {
                "additionalProperties": true,
                "type": "object",
                "required": [
                  "type"
                ],
                "properties": {
                  "type": {
                    "type": "string"
                  }
                }
              }
            },
            "details": {
              "type": "object",
              "patternProperties": {
                "^(.*)$": {}
              }
            }
          }
        },
        "isError": {
          "type": "boolean"
        }
      }
    },
    "host_tool_cancel": {
      "type": "object",
      "required": [
        "type",
        "id",
        "targetId"
      ],
      "properties": {
        "type": {
          "const": "host_tool_cancel",
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "targetId": {
          "type": "string"
        }
      }
    },
    "page_context_snapshot": {
      "type": "object",
      "required": [
        "v",
        "capturedAt",
        "tabId",
        "url",
        "path",
        "title",
        "ax",
        "api",
        "truncated"
      ],
      "properties": {
        "v": {
          "const": 1,
          "type": "number"
        },
        "capturedAt": {
          "type": "number"
        },
        "tabId": {
          "type": "number"
        },
        "url": {
          "type": "string"
        },
        "path": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "ax": {
          "anyOf": [
            {
              "type": "null"
            },
            {
              "additionalProperties": true,
              "type": "object",
              "required": [
                "role"
              ],
              "properties": {
                "role": {
                  "type": "string"
                }
              }
            }
          ]
        },
        "api": {
          "anyOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "required": [
                "url",
                "status",
                "resourceType",
                "body",
                "truncated"
              ],
              "properties": {
                "url": {
                  "type": "string"
                },
                "status": {
                  "type": "number"
                },
                "resourceType": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "body": {},
                "truncated": {
                  "type": "boolean"
                }
              }
            }
          ]
        },
        "truncated": {
          "type": "boolean"
        }
      }
    },
    "chat_media": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "id",
        "media"
      ],
      "properties": {
        "type": {
          "const": "chat_media"
        },
        "id": {
          "type": "string",
          "pattern": "^c-"
        },
        "media": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "version",
            "id",
            "kind",
            "provenance",
            "playback"
          ],
          "anyOf": [
            {
              "required": [
                "original"
              ]
            },
            {
              "required": [
                "poster"
              ]
            },
            {
              "required": [
                "timeline"
              ]
            }
          ],
          "properties": {
            "version": {
              "const": 1
            },
            "id": {
              "type": "string",
              "pattern": "^media_[a-f0-9]{24}$"
            },
            "kind": {
              "enum": [
                "image",
                "video",
                "animation",
                "raster-timeline",
                "text-timeline"
              ]
            },
            "width": {
              "type": "integer",
              "minimum": 1
            },
            "height": {
              "type": "integer",
              "minimum": 1
            },
            "durationMs": {
              "type": "integer",
              "minimum": 1
            },
            "caption": {
              "type": "string"
            },
            "alt": {
              "type": "string"
            },
            "original": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "ref",
                "mimeType",
                "bytes"
              ],
              "properties": {
                "ref": {
                  "type": "string",
                  "pattern": "^blob:sha256:[a-f0-9]{64}$"
                },
                "mimeType": {
                  "enum": [
                    "image/png",
                    "image/jpeg",
                    "image/gif",
                    "image/webp",
                    "video/mp4",
                    "text/plain"
                  ]
                },
                "bytes": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "poster": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "ref",
                "mimeType",
                "bytes"
              ],
              "properties": {
                "ref": {
                  "type": "string",
                  "pattern": "^blob:sha256:[a-f0-9]{64}$"
                },
                "mimeType": {
                  "enum": [
                    "image/png",
                    "image/jpeg",
                    "image/gif",
                    "image/webp",
                    "video/mp4",
                    "text/plain"
                  ]
                },
                "bytes": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "timeline": {
              "type": "array",
              "minItems": 1,
              "items": {
                "oneOf": [
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "text",
                      "durationMs"
                    ],
                    "properties": {
                      "text": {
                        "type": "string"
                      },
                      "durationMs": {
                        "type": "integer",
                        "minimum": 1
                      }
                    }
                  },
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "asset",
                      "durationMs"
                    ],
                    "properties": {
                      "asset": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "ref",
                          "mimeType",
                          "bytes"
                        ],
                        "properties": {
                          "ref": {
                            "type": "string",
                            "pattern": "^blob:sha256:[a-f0-9]{64}$"
                          },
                          "mimeType": {
                            "enum": [
                              "image/png",
                              "image/jpeg",
                              "image/gif",
                              "image/webp",
                              "video/mp4",
                              "text/plain"
                            ]
                          },
                          "bytes": {
                            "type": "integer",
                            "minimum": 1
                          }
                        }
                      },
                      "durationMs": {
                        "type": "integer",
                        "minimum": 1
                      }
                    }
                  }
                ]
              }
            },
            "provenance": {
              "oneOf": [
                {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "sourceType",
                    "source"
                  ],
                  "properties": {
                    "sourceType": {
                      "const": "tool"
                    },
                    "source": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_]{0,63}$"
                    }
                  }
                },
                {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "sourceType",
                    "source"
                  ],
                  "properties": {
                    "sourceType": {
                      "const": "url"
                    },
                    "source": {
                      "type": "string",
                      "pattern": "^https://[^?#]+$"
                    }
                  }
                }
              ]
            },
            "playback": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "autoplay",
                "loop",
                "muted",
                "fpsCap"
              ],
              "properties": {
                "autoplay": {
                  "type": "boolean"
                },
                "loop": {
                  "type": "boolean"
                },
                "muted": {
                  "const": true
                },
                "fpsCap": {
                  "type": "number",
                  "minimum": 1,
                  "maximum": 60
                }
              }
            },
            "degradation": {
              "type": "string"
            },
            "filenameHint": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[^/\\\\]+$"
            },
            "metadata": {
              "type": "object",
              "maxProperties": 16,
              "propertyNames": {
                "pattern": "^[a-zA-Z0-9_.-]{1,64}$"
              },
              "additionalProperties": {
                "type": "string",
                "maxLength": 512
              }
            }
          }
        }
      }
    },
    "media_asset_read": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "requestId",
        "ref"
      ],
      "properties": {
        "type": {
          "const": "media_asset_read"
        },
        "requestId": {
          "type": "string",
          "minLength": 1
        },
        "ref": {
          "type": "string",
          "pattern": "^blob:sha256:[a-f0-9]{64}$"
        },
        "offset": {
          "type": "integer",
          "minimum": 0
        },
        "length": {
          "type": "integer",
          "minimum": 1
        }
      }
    },
    "media_asset_chunk": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "requestId",
        "chunk"
      ],
      "properties": {
        "type": {
          "const": "media_asset_chunk"
        },
        "requestId": {
          "type": "string",
          "minLength": 1
        },
        "chunk": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "ref",
            "mimeType",
            "offset",
            "nextOffset",
            "eof",
            "bytes",
            "data"
          ],
          "properties": {
            "ref": {
              "type": "string",
              "pattern": "^blob:sha256:[a-f0-9]{64}$"
            },
            "mimeType": {
              "enum": [
                "image/png",
                "image/jpeg",
                "image/gif",
                "image/webp",
                "video/mp4",
                "text/plain"
              ]
            },
            "offset": {
              "type": "integer",
              "minimum": 0
            },
            "nextOffset": {
              "type": "integer",
              "minimum": 0
            },
            "eof": {
              "type": "boolean"
            },
            "bytes": {
              "type": "integer",
              "minimum": 0,
              "maximum": 262144
            },
            "data": {
              "type": "string"
            }
          }
        }
      }
    },
    "media_asset_error": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "requestId",
        "error"
      ],
      "properties": {
        "type": {
          "const": "media_asset_error"
        },
        "requestId": {
          "type": "string",
          "minLength": 1
        },
        "error": {
          "const": "asset-unavailable"
        }
      }
    }
  },
  "examples": {
    "valid": {
      "page_context_snapshot": {
        "v": 1,
        "capturedAt": 1719000000000,
        "tabId": 7,
        "url": "https://example-corp.console.ves.volterra.io/web/namespaces/default/http_loadbalancers/lb1",
        "path": "/web/namespaces/default/http_loadbalancers/lb1",
        "title": "lb1 — Distributed Cloud",
        "ax": {
          "role": "WebArea",
          "name": "lb1",
          "children": [
            {
              "role": "button",
              "name": "Edit",
              "ref": "e12"
            }
          ]
        },
        "api": {
          "url": "/api/config/namespaces/default/http_loadbalancers/lb1",
          "status": 200,
          "resourceType": "http_loadbalancers",
          "body": {
            "metadata": {
              "name": "lb1"
            },
            "spec": {
              "domains": [
                "lb1.example.com"
              ]
            }
          },
          "truncated": false
        },
        "truncated": false
      },
      "chat_request": {
        "type": "chat_request",
        "id": "c-1111",
        "text": "What does this load balancer do?",
        "context": {
          "v": 1,
          "capturedAt": 1719000000000,
          "tabId": 7,
          "url": "https://example-corp.console.ves.volterra.io/web/namespaces/default/http_loadbalancers/lb1",
          "path": "/web/namespaces/default/http_loadbalancers/lb1",
          "title": "lb1 — Distributed Cloud",
          "ax": {
            "role": "WebArea",
            "name": "lb1",
            "children": [
              {
                "role": "button",
                "name": "Edit",
                "ref": "e12"
              }
            ]
          },
          "api": {
            "url": "/api/config/namespaces/default/http_loadbalancers/lb1",
            "status": 200,
            "resourceType": "http_loadbalancers",
            "body": {
              "metadata": {
                "name": "lb1"
              },
              "spec": {
                "domains": [
                  "lb1.example.com"
                ]
              }
            },
            "truncated": false
          },
          "truncated": false
        },
        "mode": "educational",
        "tabId": 7,
        "sessionKey": "example-corp|production",
        "history_hint": "conv-1"
      },
      "chat_request_no_context": {
        "type": "chat_request",
        "id": "c-2222",
        "text": "help me build a WAF policy",
        "context": null,
        "mode": "configuration",
        "tabId": 7,
        "sessionKey": "example-corp|production"
      },
      "chat_stop": {
        "type": "chat_stop",
        "id": "c-1111"
      },
      "chat_delta": {
        "type": "chat_delta",
        "id": "c-1111",
        "seq": 0,
        "delta": "This LB "
      },
      "chat_delta_1": {
        "type": "chat_delta",
        "id": "c-1111",
        "seq": 1,
        "delta": "routes traffic."
      },
      "chat_done": {
        "type": "chat_done",
        "id": "c-1111",
        "references": [
          {
            "kind": "doc",
            "title": "HTTP LB",
            "url": "https://docs.cloud.f5.com/docs/how-to"
          }
        ]
      },
      "chat_done_no_refs": {
        "type": "chat_done",
        "id": "c-1111"
      },
      "chat_error": {
        "type": "chat_error",
        "id": "c-1111",
        "reason": "provider-4xx"
      },
      "chat_tool_notice": {
        "type": "chat_tool_notice",
        "id": "c-1111",
        "tool": "navigate",
        "ok": true
      },
      "chat_keepalive": {
        "type": "chat_keepalive",
        "id": "c-1111"
      },
      "set_host_tools": {
        "type": "set_host_tools",
        "tools": [
          {
            "name": "office_read_range",
            "label": "Read range",
            "description": "Read a cell range from the active worksheet.",
            "parameters": {
              "type": "object",
              "properties": {
                "range": {
                  "type": "string"
                }
              },
              "required": [
                "range"
              ]
            }
          }
        ]
      },
      "set_host_tools_ack": {
        "type": "set_host_tools_ack",
        "toolNames": [
          "office_read_range"
        ]
      },
      "set_host_tools_error": {
        "type": "set_host_tools_error",
        "reason": "host-tools-rejected"
      },
      "host_tool_call": {
        "type": "host_tool_call",
        "id": "7295551234567890",
        "toolCallId": "call_abc",
        "toolName": "office_read_range",
        "arguments": {
          "range": "A1:B2"
        }
      },
      "host_tool_update": {
        "type": "host_tool_update",
        "id": "7295551234567890",
        "partialResult": {
          "content": [
            {
              "type": "text",
              "text": "reading range…"
            }
          ]
        }
      },
      "host_tool_result": {
        "type": "host_tool_result",
        "id": "7295551234567890",
        "result": {
          "content": [
            {
              "type": "text",
              "text": "A1=1, B1=2, A2=3, B2=4"
            }
          ]
        }
      },
      "host_tool_cancel": {
        "type": "host_tool_cancel",
        "id": "7295551234567891",
        "targetId": "7295551234567890"
      },
      "chat_media": {
        "type": "chat_media",
        "id": "c-1",
        "media": {
          "version": 1,
          "id": "media_aaaaaaaaaaaaaaaaaaaaaaaa",
          "kind": "image",
          "original": {
            "ref": "blob:sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            "mimeType": "image/png",
            "bytes": 3
          },
          "provenance": {
            "sourceType": "tool",
            "source": "display_media"
          },
          "playback": {
            "autoplay": false,
            "loop": false,
            "muted": true,
            "fpsCap": 12
          }
        }
      },
      "media_asset_read": {
        "type": "media_asset_read",
        "requestId": "media-1",
        "ref": "blob:sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "offset": 0,
        "length": 262144
      },
      "media_asset_chunk": {
        "type": "media_asset_chunk",
        "requestId": "media-1",
        "chunk": {
          "ref": "blob:sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
          "mimeType": "image/png",
          "offset": 0,
          "nextOffset": 3,
          "eof": true,
          "bytes": 3,
          "data": "aW1n"
        }
      },
      "media_asset_error": {
        "type": "media_asset_error",
        "requestId": "media-1",
        "error": "asset-unavailable"
      }
    },
    "invalid": [
      {
        "schema": "chat_request",
        "why": "id missing c- prefix",
        "value": {
          "type": "chat_request",
          "id": "x-1111",
          "text": "What does this load balancer do?",
          "context": {
            "v": 1,
            "capturedAt": 1719000000000,
            "tabId": 7,
            "url": "https://example-corp.console.ves.volterra.io/web/namespaces/default/http_loadbalancers/lb1",
            "path": "/web/namespaces/default/http_loadbalancers/lb1",
            "title": "lb1 — Distributed Cloud",
            "ax": {
              "role": "WebArea",
              "name": "lb1",
              "children": [
                {
                  "role": "button",
                  "name": "Edit",
                  "ref": "e12"
                }
              ]
            },
            "api": {
              "url": "/api/config/namespaces/default/http_loadbalancers/lb1",
              "status": 200,
              "resourceType": "http_loadbalancers",
              "body": {
                "metadata": {
                  "name": "lb1"
                },
                "spec": {
                  "domains": [
                    "lb1.example.com"
                  ]
                }
              },
              "truncated": false
            },
            "truncated": false
          },
          "mode": "educational",
          "tabId": 7,
          "sessionKey": "example-corp|production",
          "history_hint": "conv-1"
        }
      },
      {
        "schema": "chat_request",
        "why": "unknown mode",
        "value": {
          "type": "chat_request",
          "id": "c-1111",
          "text": "What does this load balancer do?",
          "context": {
            "v": 1,
            "capturedAt": 1719000000000,
            "tabId": 7,
            "url": "https://example-corp.console.ves.volterra.io/web/namespaces/default/http_loadbalancers/lb1",
            "path": "/web/namespaces/default/http_loadbalancers/lb1",
            "title": "lb1 — Distributed Cloud",
            "ax": {
              "role": "WebArea",
              "name": "lb1",
              "children": [
                {
                  "role": "button",
                  "name": "Edit",
                  "ref": "e12"
                }
              ]
            },
            "api": {
              "url": "/api/config/namespaces/default/http_loadbalancers/lb1",
              "status": 200,
              "resourceType": "http_loadbalancers",
              "body": {
                "metadata": {
                  "name": "lb1"
                },
                "spec": {
                  "domains": [
                    "lb1.example.com"
                  ]
                }
              },
              "truncated": false
            },
            "truncated": false
          },
          "mode": "wizard",
          "tabId": 7,
          "sessionKey": "example-corp|production",
          "history_hint": "conv-1"
        }
      },
      {
        "schema": "chat_request",
        "why": "missing text",
        "value": {
          "type": "chat_request",
          "id": "c-1",
          "context": null,
          "mode": "educational",
          "tabId": 7,
          "sessionKey": "example-corp|production"
        }
      },
      {
        "schema": "chat_request",
        "why": "missing tabId",
        "value": {
          "type": "chat_request",
          "id": "c-1111",
          "text": "What does this load balancer do?",
          "context": {
            "v": 1,
            "capturedAt": 1719000000000,
            "tabId": 7,
            "url": "https://example-corp.console.ves.volterra.io/web/namespaces/default/http_loadbalancers/lb1",
            "path": "/web/namespaces/default/http_loadbalancers/lb1",
            "title": "lb1 — Distributed Cloud",
            "ax": {
              "role": "WebArea",
              "name": "lb1",
              "children": [
                {
                  "role": "button",
                  "name": "Edit",
                  "ref": "e12"
                }
              ]
            },
            "api": {
              "url": "/api/config/namespaces/default/http_loadbalancers/lb1",
              "status": 200,
              "resourceType": "http_loadbalancers",
              "body": {
                "metadata": {
                  "name": "lb1"
                },
                "spec": {
                  "domains": [
                    "lb1.example.com"
                  ]
                }
              },
              "truncated": false
            },
            "truncated": false
          },
          "mode": "educational",
          "sessionKey": "example-corp|production"
        }
      },
      {
        "schema": "chat_request",
        "why": "missing sessionKey",
        "value": {
          "type": "chat_request",
          "id": "c-1111",
          "text": "What does this load balancer do?",
          "context": {
            "v": 1,
            "capturedAt": 1719000000000,
            "tabId": 7,
            "url": "https://example-corp.console.ves.volterra.io/web/namespaces/default/http_loadbalancers/lb1",
            "path": "/web/namespaces/default/http_loadbalancers/lb1",
            "title": "lb1 — Distributed Cloud",
            "ax": {
              "role": "WebArea",
              "name": "lb1",
              "children": [
                {
                  "role": "button",
                  "name": "Edit",
                  "ref": "e12"
                }
              ]
            },
            "api": {
              "url": "/api/config/namespaces/default/http_loadbalancers/lb1",
              "status": 200,
              "resourceType": "http_loadbalancers",
              "body": {
                "metadata": {
                  "name": "lb1"
                },
                "spec": {
                  "domains": [
                    "lb1.example.com"
                  ]
                }
              },
              "truncated": false
            },
            "truncated": false
          },
          "mode": "educational",
          "tabId": 7
        }
      },
      {
        "schema": "chat_error",
        "why": "missing reason",
        "value": {
          "type": "chat_error",
          "id": "c-1"
        }
      },
      {
        "schema": "chat_delta",
        "why": "missing seq",
        "value": {
          "type": "chat_delta",
          "id": "c-1",
          "delta": "x"
        }
      },
      {
        "schema": "page_context_snapshot",
        "why": "wrong version",
        "value": {
          "v": 2,
          "capturedAt": 1719000000000,
          "tabId": 7,
          "url": "https://example-corp.console.ves.volterra.io/web/namespaces/default/http_loadbalancers/lb1",
          "path": "/web/namespaces/default/http_loadbalancers/lb1",
          "title": "lb1 — Distributed Cloud",
          "ax": {
            "role": "WebArea",
            "name": "lb1",
            "children": [
              {
                "role": "button",
                "name": "Edit",
                "ref": "e12"
              }
            ]
          },
          "api": {
            "url": "/api/config/namespaces/default/http_loadbalancers/lb1",
            "status": 200,
            "resourceType": "http_loadbalancers",
            "body": {
              "metadata": {
                "name": "lb1"
              },
              "spec": {
                "domains": [
                  "lb1.example.com"
                ]
              }
            },
            "truncated": false
          },
          "truncated": false
        }
      },
      {
        "schema": "set_host_tools",
        "why": "tool missing description",
        "value": {
          "type": "set_host_tools",
          "tools": [
            {
              "name": "x",
              "parameters": {}
            }
          ]
        }
      },
      {
        "schema": "host_tool_call",
        "why": "missing toolName",
        "value": {
          "type": "host_tool_call",
          "id": "1",
          "toolCallId": "c",
          "arguments": {}
        }
      },
      {
        "schema": "host_tool_result",
        "why": "result.content is not an array",
        "value": {
          "type": "host_tool_result",
          "id": "1",
          "result": {
            "content": "nope"
          }
        }
      },
      {
        "schema": "media_asset_read",
        "why": "negative offset",
        "value": {
          "type": "media_asset_read",
          "requestId": "r",
          "ref": "blob:sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
          "offset": -1
        }
      },
      {
        "schema": "chat_media",
        "why": "local path provenance is not transport-safe",
        "value": {
          "type": "chat_media",
          "id": "c-1",
          "media": {
            "version": 1,
            "id": "media_aaaaaaaaaaaaaaaaaaaaaaaa",
            "kind": "image",
            "original": {
              "ref": "blob:sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
              "mimeType": "image/png",
              "bytes": 3
            },
            "provenance": {
              "sourceType": "path",
              "source": "/private/image.png"
            },
            "playback": {
              "autoplay": false,
              "loop": false,
              "muted": true,
              "fpsCap": 12
            }
          }
        }
      },
      {
        "schema": "media_asset_chunk",
        "why": "chunk exceeds the bounded transport limit",
        "value": {
          "type": "media_asset_chunk",
          "requestId": "r",
          "chunk": {
            "ref": "blob:sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            "mimeType": "image/png",
            "offset": 0,
            "nextOffset": 262145,
            "eof": false,
            "bytes": 262145,
            "data": ""
          }
        }
      }
    ]
  }
}
