{
  "asyncapi": "3.0.0",
  "id": "urn:softmax:aide:1.0.0",
  "info": {
    "title": "Softmax AIDE interface",
    "version": "1.0.0",
    "description": "Public contract owned by softmax.com. This document describes the relay: send/receive are from its viewpoint. Both connections expose the same logical interface; backend frames add authenticated frontend routing. Download protocol.md for behavioral requirements. Publication does not activate a relay or certify an implementation.",
    "contact": {
      "name": "Softmax",
      "url": "https://softmax.com"
    },
    "externalDocs": {
      "description": "Normative protocol behavior and WebSocket binding",
      "url": "https://softmax.com/docs/static/aide/1.0.0/protocol.md"
    }
  },
  "defaultContentType": "application/json",
  "channels": {
    "frontend": {
      "address": "/v2/workspaces/{workspace_id}/aide/1.0.0/frontend",
      "title": "Frontend connection",
      "description": "Authenticated workspace owner. Bare JSON-RPC application frames. Endpoint is relative to the platform API base URL.",
      "parameters": {
        "workspace_id": {
          "description": "Workspace identifier bound by authenticated transport. Never authorization by itself."
        }
      },
      "bindings": {
        "ws": {
          "method": "GET",
          "headers": {
            "type": "object",
            "properties": {
              "Sec-WebSocket-Protocol": {
                "type": "string",
                "const": "aide.1.0.0"
              }
            },
            "required": [
              "Sec-WebSocket-Protocol"
            ]
          },
          "bindingVersion": "0.1.0"
        }
      },
      "messages": {
        "error": {
          "$ref": "#/components/messages/frontend_error"
        },
        "session_open": {
          "$ref": "#/components/messages/frontend_session_open"
        },
        "session_open_result": {
          "$ref": "#/components/messages/frontend_session_open_result"
        },
        "chat_send": {
          "$ref": "#/components/messages/frontend_chat_send"
        },
        "chat_send_result": {
          "$ref": "#/components/messages/frontend_chat_send_result"
        },
        "state_list": {
          "$ref": "#/components/messages/frontend_state_list"
        },
        "state_list_result": {
          "$ref": "#/components/messages/frontend_state_list_result"
        },
        "state_get": {
          "$ref": "#/components/messages/frontend_state_get"
        },
        "state_get_result": {
          "$ref": "#/components/messages/frontend_state_get_result"
        },
        "chat_history": {
          "$ref": "#/components/messages/frontend_chat_history"
        },
        "chat_history_result": {
          "$ref": "#/components/messages/frontend_chat_history_result"
        },
        "chat_events": {
          "$ref": "#/components/messages/frontend_chat_events"
        },
        "chat_events_result": {
          "$ref": "#/components/messages/frontend_chat_events_result"
        },
        "task_cancel": {
          "$ref": "#/components/messages/frontend_task_cancel"
        },
        "task_cancel_result": {
          "$ref": "#/components/messages/frontend_task_cancel_result"
        },
        "chat_cancel": {
          "$ref": "#/components/messages/frontend_chat_cancel"
        },
        "input_respond": {
          "$ref": "#/components/messages/frontend_input_respond"
        },
        "input_respond_result": {
          "$ref": "#/components/messages/frontend_input_respond_result"
        },
        "browser_snapshot": {
          "$ref": "#/components/messages/frontend_browser_snapshot"
        },
        "browser_snapshot_result": {
          "$ref": "#/components/messages/frontend_browser_snapshot_result"
        },
        "browser_act": {
          "$ref": "#/components/messages/frontend_browser_act"
        },
        "browser_act_result": {
          "$ref": "#/components/messages/frontend_browser_act_result"
        },
        "state_changed": {
          "$ref": "#/components/messages/frontend_state_changed"
        },
        "chat_message": {
          "$ref": "#/components/messages/frontend_chat_message"
        },
        "chat_chunk": {
          "$ref": "#/components/messages/frontend_chat_chunk"
        },
        "chat_event": {
          "$ref": "#/components/messages/frontend_chat_event"
        },
        "chat_finished": {
          "$ref": "#/components/messages/frontend_chat_finished"
        },
        "browser_changed": {
          "$ref": "#/components/messages/frontend_browser_changed"
        },
        "aide_presence": {
          "$ref": "#/components/messages/frontend_aide_presence"
        },
        "binding": {
          "$ref": "#/components/messages/frontend_binding"
        },
        "session_page": {
          "$ref": "#/components/messages/frontend_session_page"
        },
        "session_page_result": {
          "$ref": "#/components/messages/frontend_session_page_result"
        },
        "surface_event": {
          "$ref": "#/components/messages/frontend_surface_event"
        },
        "surface_event_result": {
          "$ref": "#/components/messages/frontend_surface_event_result"
        },
        "surface_act": {
          "$ref": "#/components/messages/frontend_surface_act"
        },
        "surface_act_result": {
          "$ref": "#/components/messages/frontend_surface_act_result"
        },
        "clarification_request": {
          "$ref": "#/components/messages/frontend_clarification_request"
        },
        "clarification_request_result": {
          "$ref": "#/components/messages/frontend_clarification_request_result"
        },
        "clarification_response": {
          "$ref": "#/components/messages/frontend_clarification_response"
        },
        "clarification_response_result": {
          "$ref": "#/components/messages/frontend_clarification_response_result"
        },
        "policy_create": {
          "$ref": "#/components/messages/frontend_policy_create"
        },
        "policy_create_result": {
          "$ref": "#/components/messages/frontend_policy_create_result"
        },
        "policy_update": {
          "$ref": "#/components/messages/frontend_policy_update"
        },
        "policy_update_result": {
          "$ref": "#/components/messages/frontend_policy_update_result"
        },
        "policy_list": {
          "$ref": "#/components/messages/frontend_policy_list"
        },
        "policy_list_result": {
          "$ref": "#/components/messages/frontend_policy_list_result"
        }
      }
    },
    "backend": {
      "address": "/v2/workspaces/{workspace_id}/aide/1.0.0/backend",
      "title": "AIDE backend connection",
      "description": "Authenticated workspace bridge. Application frames wrap JSON-RPC as {frontend_id,message}. Endpoint is relative to the platform API base URL.",
      "parameters": {
        "workspace_id": {
          "description": "Workspace identifier bound by authenticated transport. Never authorization by itself."
        }
      },
      "bindings": {
        "ws": {
          "method": "GET",
          "headers": {
            "type": "object",
            "properties": {
              "Sec-WebSocket-Protocol": {
                "type": "string",
                "const": "aide.1.0.0"
              }
            },
            "required": [
              "Sec-WebSocket-Protocol"
            ]
          },
          "bindingVersion": "0.1.0"
        }
      },
      "messages": {
        "error": {
          "$ref": "#/components/messages/backend_error"
        },
        "session_open": {
          "$ref": "#/components/messages/backend_session_open"
        },
        "session_open_result": {
          "$ref": "#/components/messages/backend_session_open_result"
        },
        "chat_send": {
          "$ref": "#/components/messages/backend_chat_send"
        },
        "chat_send_result": {
          "$ref": "#/components/messages/backend_chat_send_result"
        },
        "state_list": {
          "$ref": "#/components/messages/backend_state_list"
        },
        "state_list_result": {
          "$ref": "#/components/messages/backend_state_list_result"
        },
        "state_get": {
          "$ref": "#/components/messages/backend_state_get"
        },
        "state_get_result": {
          "$ref": "#/components/messages/backend_state_get_result"
        },
        "chat_history": {
          "$ref": "#/components/messages/backend_chat_history"
        },
        "chat_history_result": {
          "$ref": "#/components/messages/backend_chat_history_result"
        },
        "chat_events": {
          "$ref": "#/components/messages/backend_chat_events"
        },
        "chat_events_result": {
          "$ref": "#/components/messages/backend_chat_events_result"
        },
        "task_cancel": {
          "$ref": "#/components/messages/backend_task_cancel"
        },
        "task_cancel_result": {
          "$ref": "#/components/messages/backend_task_cancel_result"
        },
        "chat_cancel": {
          "$ref": "#/components/messages/backend_chat_cancel"
        },
        "input_respond": {
          "$ref": "#/components/messages/backend_input_respond"
        },
        "input_respond_result": {
          "$ref": "#/components/messages/backend_input_respond_result"
        },
        "browser_snapshot": {
          "$ref": "#/components/messages/backend_browser_snapshot"
        },
        "browser_snapshot_result": {
          "$ref": "#/components/messages/backend_browser_snapshot_result"
        },
        "browser_act": {
          "$ref": "#/components/messages/backend_browser_act"
        },
        "browser_act_result": {
          "$ref": "#/components/messages/backend_browser_act_result"
        },
        "state_changed": {
          "$ref": "#/components/messages/backend_state_changed"
        },
        "chat_message": {
          "$ref": "#/components/messages/backend_chat_message"
        },
        "chat_chunk": {
          "$ref": "#/components/messages/backend_chat_chunk"
        },
        "chat_event": {
          "$ref": "#/components/messages/backend_chat_event"
        },
        "chat_finished": {
          "$ref": "#/components/messages/backend_chat_finished"
        },
        "browser_changed": {
          "$ref": "#/components/messages/backend_browser_changed"
        },
        "binding": {
          "$ref": "#/components/messages/backend_binding"
        },
        "frontend_closed": {
          "$ref": "#/components/messages/backend_frontend_closed"
        },
        "session_page": {
          "$ref": "#/components/messages/backend_session_page"
        },
        "session_page_result": {
          "$ref": "#/components/messages/backend_session_page_result"
        },
        "surface_event": {
          "$ref": "#/components/messages/backend_surface_event"
        },
        "surface_event_result": {
          "$ref": "#/components/messages/backend_surface_event_result"
        },
        "surface_act": {
          "$ref": "#/components/messages/backend_surface_act"
        },
        "surface_act_result": {
          "$ref": "#/components/messages/backend_surface_act_result"
        },
        "clarification_request": {
          "$ref": "#/components/messages/backend_clarification_request"
        },
        "clarification_request_result": {
          "$ref": "#/components/messages/backend_clarification_request_result"
        },
        "clarification_response": {
          "$ref": "#/components/messages/backend_clarification_response"
        },
        "clarification_response_result": {
          "$ref": "#/components/messages/backend_clarification_response_result"
        },
        "policy_create": {
          "$ref": "#/components/messages/backend_policy_create"
        },
        "policy_create_result": {
          "$ref": "#/components/messages/backend_policy_create_result"
        },
        "policy_update": {
          "$ref": "#/components/messages/backend_policy_update"
        },
        "policy_update_result": {
          "$ref": "#/components/messages/backend_policy_update_result"
        },
        "policy_list": {
          "$ref": "#/components/messages/backend_policy_list"
        },
        "policy_list_result": {
          "$ref": "#/components/messages/backend_policy_list_result"
        }
      }
    }
  },
  "operations": {
    "frontend_session_open": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/frontend"
      },
      "title": "session.open",
      "summary": "Ask AIDE to create a conversation. The returned session is authoritative.",
      "description": "Frontend \u2192 AIDE. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/frontend/messages/session_open"
        }
      ],
      "tags": [
        {
          "name": "Frontend \u2192 AIDE"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/frontend"
        },
        "messages": [
          {
            "$ref": "#/channels/frontend/messages/session_open_result"
          },
          {
            "$ref": "#/channels/frontend/messages/error"
          }
        ]
      }
    },
    "backend_session_open": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/backend"
      },
      "title": "session.open",
      "summary": "Ask AIDE to create a conversation. The returned session is authoritative.",
      "description": "Frontend \u2192 AIDE. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/backend/messages/session_open"
        }
      ],
      "tags": [
        {
          "name": "Frontend \u2192 AIDE"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/backend"
        },
        "messages": [
          {
            "$ref": "#/channels/backend/messages/session_open_result"
          },
          {
            "$ref": "#/channels/backend/messages/error"
          }
        ]
      }
    },
    "frontend_chat_send": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/frontend"
      },
      "title": "chat.send",
      "summary": "Append ordered OpenAI messages atomically. Acceptance records recoverable responsibility; it does not mean completion. request_id equals the request id.",
      "description": "Frontend \u2192 AIDE. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/frontend/messages/chat_send"
        }
      ],
      "tags": [
        {
          "name": "Frontend \u2192 AIDE"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/frontend"
        },
        "messages": [
          {
            "$ref": "#/channels/frontend/messages/chat_send_result"
          },
          {
            "$ref": "#/channels/frontend/messages/error"
          }
        ]
      }
    },
    "backend_chat_send": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/backend"
      },
      "title": "chat.send",
      "summary": "Append ordered OpenAI messages atomically. Acceptance records recoverable responsibility; it does not mean completion. request_id equals the request id.",
      "description": "Frontend \u2192 AIDE. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/backend/messages/chat_send"
        }
      ],
      "tags": [
        {
          "name": "Frontend \u2192 AIDE"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/backend"
        },
        "messages": [
          {
            "$ref": "#/channels/backend/messages/chat_send_result"
          },
          {
            "$ref": "#/channels/backend/messages/error"
          }
        ]
      }
    },
    "frontend_state_list": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/frontend"
      },
      "title": "state.list",
      "summary": "Read a complete, paginated inventory of sessions, tasks, goals, or one session's requests. Unsupported resources return unsupported, never a misleading empty list.",
      "description": "Frontend \u2192 AIDE. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/frontend/messages/state_list"
        }
      ],
      "tags": [
        {
          "name": "Frontend \u2192 AIDE"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/frontend"
        },
        "messages": [
          {
            "$ref": "#/channels/frontend/messages/state_list_result"
          },
          {
            "$ref": "#/channels/frontend/messages/error"
          }
        ]
      }
    },
    "backend_state_list": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/backend"
      },
      "title": "state.list",
      "summary": "Read a complete, paginated inventory of sessions, tasks, goals, or one session's requests. Unsupported resources return unsupported, never a misleading empty list.",
      "description": "Frontend \u2192 AIDE. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/backend/messages/state_list"
        }
      ],
      "tags": [
        {
          "name": "Frontend \u2192 AIDE"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/backend"
        },
        "messages": [
          {
            "$ref": "#/channels/backend/messages/state_list_result"
          },
          {
            "$ref": "#/channels/backend/messages/error"
          }
        ]
      }
    },
    "frontend_state_get": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/frontend"
      },
      "title": "state.get",
      "summary": "Read one public state object. The result resource and object id must match the request.",
      "description": "Frontend \u2192 AIDE. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/frontend/messages/state_get"
        }
      ],
      "tags": [
        {
          "name": "Frontend \u2192 AIDE"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/frontend"
        },
        "messages": [
          {
            "$ref": "#/channels/frontend/messages/state_get_result"
          },
          {
            "$ref": "#/channels/frontend/messages/error"
          }
        ]
      }
    },
    "backend_state_get": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/backend"
      },
      "title": "state.get",
      "summary": "Read one public state object. The result resource and object id must match the request.",
      "description": "Frontend \u2192 AIDE. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/backend/messages/state_get"
        }
      ],
      "tags": [
        {
          "name": "Frontend \u2192 AIDE"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/backend"
        },
        "messages": [
          {
            "$ref": "#/channels/backend/messages/state_get_result"
          },
          {
            "$ref": "#/channels/backend/messages/error"
          }
        ]
      }
    },
    "frontend_chat_history": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/frontend"
      },
      "title": "chat.history",
      "summary": "Read retained complete OpenAI messages, including assistant tool calls and tool results. Cursors are opaque.",
      "description": "Frontend \u2192 AIDE. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/frontend/messages/chat_history"
        }
      ],
      "tags": [
        {
          "name": "Frontend \u2192 AIDE"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/frontend"
        },
        "messages": [
          {
            "$ref": "#/channels/frontend/messages/chat_history_result"
          },
          {
            "$ref": "#/channels/frontend/messages/error"
          }
        ]
      }
    },
    "frontend_chat_events": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/frontend"
      },
      "title": "chat.events",
      "summary": "Read one chat request's progress events after a cursor, in cursor order. Pages fit the message limit; continue from next until done.",
      "description": "Frontend \u2192 AIDE. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/frontend/messages/chat_events"
        }
      ],
      "tags": [
        {
          "name": "Frontend \u2192 AIDE"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/frontend"
        },
        "messages": [
          {
            "$ref": "#/channels/frontend/messages/chat_events_result"
          },
          {
            "$ref": "#/channels/frontend/messages/error"
          }
        ]
      }
    },
    "backend_chat_history": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/backend"
      },
      "title": "chat.history",
      "summary": "Read retained complete OpenAI messages, including assistant tool calls and tool results. Cursors are opaque.",
      "description": "Frontend \u2192 AIDE. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/backend/messages/chat_history"
        }
      ],
      "tags": [
        {
          "name": "Frontend \u2192 AIDE"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/backend"
        },
        "messages": [
          {
            "$ref": "#/channels/backend/messages/chat_history_result"
          },
          {
            "$ref": "#/channels/backend/messages/error"
          }
        ]
      }
    },
    "backend_chat_events": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/backend"
      },
      "title": "chat.events",
      "summary": "Read one chat request's progress events after a cursor, in cursor order. Pages fit the message limit; continue from next until done.",
      "description": "Frontend \u2192 AIDE. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/backend/messages/chat_events"
        }
      ],
      "tags": [
        {
          "name": "Frontend \u2192 AIDE"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/backend"
        },
        "messages": [
          {
            "$ref": "#/channels/backend/messages/chat_events_result"
          },
          {
            "$ref": "#/channels/backend/messages/error"
          }
        ]
      }
    },
    "frontend_task_cancel": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/frontend"
      },
      "title": "task.cancel",
      "summary": "Ask AIDE to cancel a task. requested=true confirms registration, not completion. Observe subsequent task state.",
      "description": "Frontend \u2192 AIDE. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/frontend/messages/task_cancel"
        }
      ],
      "tags": [
        {
          "name": "Frontend \u2192 AIDE"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/frontend"
        },
        "messages": [
          {
            "$ref": "#/channels/frontend/messages/task_cancel_result"
          },
          {
            "$ref": "#/channels/frontend/messages/error"
          }
        ]
      }
    },
    "backend_task_cancel": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/backend"
      },
      "title": "task.cancel",
      "summary": "Ask AIDE to cancel a task. requested=true confirms registration, not completion. Observe subsequent task state.",
      "description": "Frontend \u2192 AIDE. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/backend/messages/task_cancel"
        }
      ],
      "tags": [
        {
          "name": "Frontend \u2192 AIDE"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/backend"
        },
        "messages": [
          {
            "$ref": "#/channels/backend/messages/task_cancel_result"
          },
          {
            "$ref": "#/channels/backend/messages/error"
          }
        ]
      }
    },
    "frontend_chat_cancel": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/frontend"
      },
      "title": "chat.cancel",
      "summary": "Ask AIDE to cancel the chat.send identified by request_id in this session. The outer id identifies this cancellation request.",
      "description": "Frontend \u2192 AIDE. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/frontend/messages/chat_cancel"
        }
      ],
      "tags": [
        {
          "name": "Frontend \u2192 AIDE"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/frontend"
        },
        "messages": [
          {
            "$ref": "#/channels/frontend/messages/task_cancel_result"
          },
          {
            "$ref": "#/channels/frontend/messages/error"
          }
        ]
      }
    },
    "backend_chat_cancel": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/backend"
      },
      "title": "chat.cancel",
      "summary": "Ask AIDE to cancel the chat.send identified by request_id in this session. The outer id identifies this cancellation request.",
      "description": "Frontend \u2192 AIDE. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/backend/messages/chat_cancel"
        }
      ],
      "tags": [
        {
          "name": "Frontend \u2192 AIDE"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/backend"
        },
        "messages": [
          {
            "$ref": "#/channels/backend/messages/task_cancel_result"
          },
          {
            "$ref": "#/channels/backend/messages/error"
          }
        ]
      }
    },
    "frontend_input_respond": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/frontend"
      },
      "title": "input.respond",
      "summary": "Answer a pending session approval (once or deny). request_id identifies the pending input. A stale answer returns conflict. Answering a pending clarification is deprecated; see clarification.response.",
      "description": "Frontend \u2192 AIDE. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/frontend/messages/input_respond"
        }
      ],
      "tags": [
        {
          "name": "Frontend \u2192 AIDE"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/frontend"
        },
        "messages": [
          {
            "$ref": "#/channels/frontend/messages/input_respond_result"
          },
          {
            "$ref": "#/channels/frontend/messages/error"
          }
        ]
      }
    },
    "backend_input_respond": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/backend"
      },
      "title": "input.respond",
      "summary": "Answer a pending session approval (once or deny). request_id identifies the pending input. A stale answer returns conflict. Answering a pending clarification is deprecated; see clarification.response.",
      "description": "Frontend \u2192 AIDE. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/backend/messages/input_respond"
        }
      ],
      "tags": [
        {
          "name": "Frontend \u2192 AIDE"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/backend"
        },
        "messages": [
          {
            "$ref": "#/channels/backend/messages/input_respond_result"
          },
          {
            "$ref": "#/channels/backend/messages/error"
          }
        ]
      }
    },
    "frontend_browser_snapshot": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/frontend"
      },
      "title": "browser.snapshot",
      "summary": "Ask the frontend for its exposed DOM tree. An empty parameter object is required; the result is a complete typed snapshot.",
      "description": "AIDE \u2192 Frontend. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/frontend/messages/browser_snapshot"
        }
      ],
      "tags": [
        {
          "name": "AIDE \u2192 Frontend"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/frontend"
        },
        "messages": [
          {
            "$ref": "#/channels/frontend/messages/browser_snapshot_result"
          },
          {
            "$ref": "#/channels/frontend/messages/error"
          }
        ]
      }
    },
    "backend_browser_snapshot": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/backend"
      },
      "title": "browser.snapshot",
      "summary": "Ask the frontend for its exposed DOM tree. An empty parameter object is required; the result is a complete typed snapshot.",
      "description": "AIDE \u2192 Frontend. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/backend/messages/browser_snapshot"
        }
      ],
      "tags": [
        {
          "name": "AIDE \u2192 Frontend"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/backend"
        },
        "messages": [
          {
            "$ref": "#/channels/backend/messages/browser_snapshot_result"
          },
          {
            "$ref": "#/channels/backend/messages/error"
          }
        ]
      }
    },
    "frontend_browser_act": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/frontend"
      },
      "title": "browser.act",
      "summary": "Ask the frontend to click, fill, or highlight one exposed node. Check document, revision, allowed action and expiry before acting. Never replay after reconnect.",
      "description": "AIDE \u2192 Frontend. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/frontend/messages/browser_act"
        }
      ],
      "tags": [
        {
          "name": "AIDE \u2192 Frontend"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/frontend"
        },
        "messages": [
          {
            "$ref": "#/channels/frontend/messages/browser_act_result"
          },
          {
            "$ref": "#/channels/frontend/messages/error"
          }
        ]
      }
    },
    "backend_browser_act": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/backend"
      },
      "title": "browser.act",
      "summary": "Ask the frontend to click, fill, or highlight one exposed node. Check document, revision, allowed action and expiry before acting. Never replay after reconnect.",
      "description": "AIDE \u2192 Frontend. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/backend/messages/browser_act"
        }
      ],
      "tags": [
        {
          "name": "AIDE \u2192 Frontend"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/backend"
        },
        "messages": [
          {
            "$ref": "#/channels/backend/messages/browser_act_result"
          },
          {
            "$ref": "#/channels/backend/messages/error"
          }
        ]
      }
    },
    "frontend_state_changed": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/frontend"
      },
      "title": "state.changed",
      "summary": "Replace one complete record, delete it, or invalidate the collection. Refetch on a revision gap or changed epoch.",
      "description": "AIDE \u2192 Frontend. Notification: no response.",
      "messages": [
        {
          "$ref": "#/channels/frontend/messages/state_changed"
        }
      ],
      "tags": [
        {
          "name": "AIDE \u2192 Frontend"
        }
      ]
    },
    "backend_state_changed": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/backend"
      },
      "title": "state.changed",
      "summary": "Replace one complete record, delete it, or invalidate the collection. Refetch on a revision gap or changed epoch.",
      "description": "AIDE \u2192 Frontend. Notification: no response.",
      "messages": [
        {
          "$ref": "#/channels/backend/messages/state_changed"
        }
      ],
      "tags": [
        {
          "name": "AIDE \u2192 Frontend"
        }
      ]
    },
    "frontend_chat_message": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/frontend"
      },
      "title": "chat.message",
      "summary": "A retained complete OpenAI message. Read history to recover missed messages.",
      "description": "AIDE \u2192 Frontend. Notification: no response.",
      "messages": [
        {
          "$ref": "#/channels/frontend/messages/chat_message"
        }
      ],
      "tags": [
        {
          "name": "AIDE \u2192 Frontend"
        }
      ]
    },
    "backend_chat_message": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/backend"
      },
      "title": "chat.message",
      "summary": "A retained complete OpenAI message. Read history to recover missed messages.",
      "description": "AIDE \u2192 Frontend. Notification: no response.",
      "messages": [
        {
          "$ref": "#/channels/backend/messages/chat_message"
        }
      ],
      "tags": [
        {
          "name": "AIDE \u2192 Frontend"
        }
      ]
    },
    "frontend_chat_chunk": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/frontend"
      },
      "title": "chat.chunk",
      "summary": "An OpenAI ChatCompletionChunk, including tool-call deltas: the OpenAI-shaped mirror of a text.delta event. Sequence starts at one per completion. cursor is that event's position; on a gap read chat.events.",
      "description": "AIDE \u2192 Frontend. Notification: no response.",
      "messages": [
        {
          "$ref": "#/channels/frontend/messages/chat_chunk"
        }
      ],
      "tags": [
        {
          "name": "AIDE \u2192 Frontend"
        }
      ]
    },
    "frontend_chat_event": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/frontend"
      },
      "title": "chat.event",
      "summary": "The push form of a ChatEvent, with the same cursor chat.events returns. A cursor that does not follow the last applied one means missed events: read chat.events.",
      "description": "AIDE \u2192 Frontend. Notification: no response.",
      "messages": [
        {
          "$ref": "#/channels/frontend/messages/chat_event"
        }
      ],
      "tags": [
        {
          "name": "AIDE \u2192 Frontend"
        }
      ]
    },
    "backend_chat_chunk": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/backend"
      },
      "title": "chat.chunk",
      "summary": "An OpenAI ChatCompletionChunk, including tool-call deltas: the OpenAI-shaped mirror of a text.delta event. Sequence starts at one per completion. cursor is that event's position; on a gap read chat.events.",
      "description": "AIDE \u2192 Frontend. Notification: no response.",
      "messages": [
        {
          "$ref": "#/channels/backend/messages/chat_chunk"
        }
      ],
      "tags": [
        {
          "name": "AIDE \u2192 Frontend"
        }
      ]
    },
    "backend_chat_event": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/backend"
      },
      "title": "chat.event",
      "summary": "The push form of a ChatEvent, with the same cursor chat.events returns. A cursor that does not follow the last applied one means missed events: read chat.events.",
      "description": "AIDE \u2192 Frontend. Notification: no response.",
      "messages": [
        {
          "$ref": "#/channels/backend/messages/chat_event"
        }
      ],
      "tags": [
        {
          "name": "AIDE \u2192 Frontend"
        }
      ]
    },
    "frontend_chat_finished": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/frontend"
      },
      "title": "chat.finished",
      "summary": "Terminal chat outcome. A failed or interrupted outcome includes an error. The request record (resource requests) stays authoritative; a missed notification is recovered by reading it.",
      "description": "AIDE \u2192 Frontend. Notification: no response.",
      "messages": [
        {
          "$ref": "#/channels/frontend/messages/chat_finished"
        }
      ],
      "tags": [
        {
          "name": "AIDE \u2192 Frontend"
        }
      ]
    },
    "backend_chat_finished": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/backend"
      },
      "title": "chat.finished",
      "summary": "Terminal chat outcome. A failed or interrupted outcome includes an error. The request record (resource requests) stays authoritative; a missed notification is recovered by reading it.",
      "description": "AIDE \u2192 Frontend. Notification: no response.",
      "messages": [
        {
          "$ref": "#/channels/backend/messages/chat_finished"
        }
      ],
      "tags": [
        {
          "name": "AIDE \u2192 Frontend"
        }
      ]
    },
    "frontend_browser_changed": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/frontend"
      },
      "title": "browser.changed",
      "summary": "A complete exposed DOM snapshot. Optional notifications may be coalesced; browser.snapshot remains the pull operation.",
      "description": "Frontend \u2192 AIDE. Notification: no response.",
      "messages": [
        {
          "$ref": "#/channels/frontend/messages/browser_changed"
        }
      ],
      "tags": [
        {
          "name": "Frontend \u2192 AIDE"
        }
      ]
    },
    "backend_browser_changed": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/backend"
      },
      "title": "browser.changed",
      "summary": "A complete exposed DOM snapshot. Optional notifications may be coalesced; browser.snapshot remains the pull operation.",
      "description": "Frontend \u2192 AIDE. Notification: no response.",
      "messages": [
        {
          "$ref": "#/channels/backend/messages/browser_changed"
        }
      ],
      "tags": [
        {
          "name": "Frontend \u2192 AIDE"
        }
      ]
    },
    "frontend_binding": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/frontend"
      },
      "messages": [
        {
          "$ref": "#/channels/frontend/messages/binding"
        }
      ],
      "summary": "Bind an authenticated connection to protocol version and message limit."
    },
    "backend_binding": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/backend"
      },
      "messages": [
        {
          "$ref": "#/channels/backend/messages/binding"
        }
      ],
      "summary": "Bind an authenticated connection to protocol version and message limit."
    },
    "backend_frontend_closed": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/backend"
      },
      "title": "frontend.closed",
      "summary": "A frontend connection ended. Relay-owned and backend-only; peers never send it.",
      "description": "Relay \u2192 AIDE. Notification: no response.",
      "messages": [
        {
          "$ref": "#/channels/backend/messages/frontend_closed"
        }
      ],
      "tags": [
        {
          "name": "Relay \u2192 AIDE"
        }
      ]
    },
    "frontend_aide_presence": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/frontend"
      },
      "title": "aide.presence",
      "summary": "Relay-owned: the workspace backend connected (present:true) or went away (present:false). On either, read every open request's record and its events from the last applied cursor. Peers never send it.",
      "description": "Relay \u2192 Frontend. Notification: no response.",
      "messages": [
        {
          "$ref": "#/channels/frontend/messages/aide_presence"
        }
      ],
      "tags": [
        {
          "name": "Relay \u2192 Frontend"
        }
      ]
    },
    "frontend_session_page": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/frontend"
      },
      "title": "session.page",
      "summary": "Offer a conversation for the viewed Coworld, or resolve the target after the user accepts.",
      "description": "Frontend \u2192 AIDE. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/frontend/messages/session_page"
        }
      ],
      "tags": [
        {
          "name": "Frontend \u2192 AIDE"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/frontend"
        },
        "messages": [
          {
            "$ref": "#/channels/frontend/messages/session_page_result"
          },
          {
            "$ref": "#/channels/frontend/messages/error"
          }
        ]
      }
    },
    "backend_session_page": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/backend"
      },
      "title": "session.page",
      "summary": "Offer a conversation for the viewed Coworld, or resolve the target after the user accepts.",
      "description": "Frontend \u2192 AIDE. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/backend/messages/session_page"
        }
      ],
      "tags": [
        {
          "name": "Frontend \u2192 AIDE"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/backend"
        },
        "messages": [
          {
            "$ref": "#/channels/backend/messages/session_page_result"
          },
          {
            "$ref": "#/channels/backend/messages/error"
          }
        ]
      }
    },
    "frontend_surface_event": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/frontend"
      },
      "title": "surface.event",
      "summary": "Report an observation of how the frontend's own state is changing. The object travels in `data`, beside its `scope`, and is defined by the frontend and AIDE; the relay checks only that it is a JSON object.",
      "description": "Frontend \u2192 AIDE. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/frontend/messages/surface_event"
        }
      ],
      "tags": [
        {
          "name": "Frontend \u2192 AIDE"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/frontend"
        },
        "messages": [
          {
            "$ref": "#/channels/frontend/messages/surface_event_result"
          },
          {
            "$ref": "#/channels/frontend/messages/error"
          }
        ]
      }
    },
    "backend_surface_event": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/backend"
      },
      "title": "surface.event",
      "summary": "Report an observation of how the frontend's own state is changing. The object travels in `data`, beside its `scope`, and is defined by the frontend and AIDE; the relay checks only that it is a JSON object.",
      "description": "Frontend \u2192 AIDE. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/backend/messages/surface_event"
        }
      ],
      "tags": [
        {
          "name": "Frontend \u2192 AIDE"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/backend"
        },
        "messages": [
          {
            "$ref": "#/channels/backend/messages/surface_event_result"
          },
          {
            "$ref": "#/channels/backend/messages/error"
          }
        ]
      }
    },
    "frontend_surface_act": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/frontend"
      },
      "title": "surface.act",
      "summary": "Ask the frontend to apply an action to itself. The object travels in `data`, beside its `scope`, and is defined by AIDE and the frontend; the relay checks only that it is a JSON object. Never replay after reconnect.",
      "description": "AIDE \u2192 Frontend. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/frontend/messages/surface_act"
        }
      ],
      "tags": [
        {
          "name": "AIDE \u2192 Frontend"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/frontend"
        },
        "messages": [
          {
            "$ref": "#/channels/frontend/messages/surface_act_result"
          },
          {
            "$ref": "#/channels/frontend/messages/error"
          }
        ]
      }
    },
    "backend_surface_act": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/backend"
      },
      "title": "surface.act",
      "summary": "Ask the frontend to apply an action to itself. The object travels in `data`, beside its `scope`, and is defined by AIDE and the frontend; the relay checks only that it is a JSON object. Never replay after reconnect.",
      "description": "AIDE \u2192 Frontend. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/backend/messages/surface_act"
        }
      ],
      "tags": [
        {
          "name": "AIDE \u2192 Frontend"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/backend"
        },
        "messages": [
          {
            "$ref": "#/channels/backend/messages/surface_act_result"
          },
          {
            "$ref": "#/channels/backend/messages/error"
          }
        ]
      }
    },
    "frontend_clarification_request": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/frontend"
      },
      "title": "clarification.request",
      "summary": "Ask the frontend a question without holding any work. The result only confirms the frontend took the question; the answer arrives later as clarification.response. Never replay after reconnect.",
      "description": "AIDE \u2192 Frontend. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/frontend/messages/clarification_request"
        }
      ],
      "tags": [
        {
          "name": "AIDE \u2192 Frontend"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/frontend"
        },
        "messages": [
          {
            "$ref": "#/channels/frontend/messages/clarification_request_result"
          },
          {
            "$ref": "#/channels/frontend/messages/error"
          }
        ]
      }
    },
    "backend_clarification_request": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/backend"
      },
      "title": "clarification.request",
      "summary": "Ask the frontend a question without holding any work. The result only confirms the frontend took the question; the answer arrives later as clarification.response. Never replay after reconnect.",
      "description": "AIDE \u2192 Frontend. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/backend/messages/clarification_request"
        }
      ],
      "tags": [
        {
          "name": "AIDE \u2192 Frontend"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/backend"
        },
        "messages": [
          {
            "$ref": "#/channels/backend/messages/clarification_request_result"
          },
          {
            "$ref": "#/channels/backend/messages/error"
          }
        ]
      }
    },
    "frontend_clarification_response": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/frontend"
      },
      "title": "clarification.response",
      "summary": "Answer a question asked with clarification.request. request_id is that request's outer id. An unwanted or differently answered question returns conflict; an unknown request_id returns not_found.",
      "description": "Frontend \u2192 AIDE. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/frontend/messages/clarification_response"
        }
      ],
      "tags": [
        {
          "name": "Frontend \u2192 AIDE"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/frontend"
        },
        "messages": [
          {
            "$ref": "#/channels/frontend/messages/clarification_response_result"
          },
          {
            "$ref": "#/channels/frontend/messages/error"
          }
        ]
      }
    },
    "backend_clarification_response": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/backend"
      },
      "title": "clarification.response",
      "summary": "Answer a question asked with clarification.request. request_id is that request's outer id. An unwanted or differently answered question returns conflict; an unknown request_id returns not_found.",
      "description": "Frontend \u2192 AIDE. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/backend/messages/clarification_response"
        }
      ],
      "tags": [
        {
          "name": "Frontend \u2192 AIDE"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/backend"
        },
        "messages": [
          {
            "$ref": "#/channels/backend/messages/clarification_response_result"
          },
          {
            "$ref": "#/channels/backend/messages/error"
          }
        ]
      }
    },
    "frontend_policy_create": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/frontend"
      },
      "title": "policy.create",
      "summary": "Ask the frontend to deploy a new policy under name. An existing name returns conflict. Never replay after reconnect.",
      "description": "AIDE \u2192 Frontend. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/frontend/messages/policy_create"
        }
      ],
      "tags": [
        {
          "name": "AIDE \u2192 Frontend"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/frontend"
        },
        "messages": [
          {
            "$ref": "#/channels/frontend/messages/policy_create_result"
          },
          {
            "$ref": "#/channels/frontend/messages/error"
          }
        ]
      }
    },
    "backend_policy_create": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/backend"
      },
      "title": "policy.create",
      "summary": "Ask the frontend to deploy a new policy under name. An existing name returns conflict. Never replay after reconnect.",
      "description": "AIDE \u2192 Frontend. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/backend/messages/policy_create"
        }
      ],
      "tags": [
        {
          "name": "AIDE \u2192 Frontend"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/backend"
        },
        "messages": [
          {
            "$ref": "#/channels/backend/messages/policy_create_result"
          },
          {
            "$ref": "#/channels/backend/messages/error"
          }
        ]
      }
    },
    "frontend_policy_update": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/frontend"
      },
      "title": "policy.update",
      "summary": "Ask the frontend to deploy new content for the policy it holds under name. An unknown name returns not_found. Never replay after reconnect.",
      "description": "AIDE \u2192 Frontend. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/frontend/messages/policy_update"
        }
      ],
      "tags": [
        {
          "name": "AIDE \u2192 Frontend"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/frontend"
        },
        "messages": [
          {
            "$ref": "#/channels/frontend/messages/policy_update_result"
          },
          {
            "$ref": "#/channels/frontend/messages/error"
          }
        ]
      }
    },
    "frontend_policy_list": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/frontend"
      },
      "title": "policy.list",
      "summary": "Ask the frontend which policies it holds in scope. Returns the name and deployed version of each. Read-only: safe to send again after reconnect.",
      "description": "AIDE \u2192 Frontend. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/frontend/messages/policy_list"
        }
      ],
      "tags": [
        {
          "name": "AIDE \u2192 Frontend"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/frontend"
        },
        "messages": [
          {
            "$ref": "#/channels/frontend/messages/policy_list_result"
          },
          {
            "$ref": "#/channels/frontend/messages/error"
          }
        ]
      }
    },
    "backend_policy_update": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/backend"
      },
      "title": "policy.update",
      "summary": "Ask the frontend to deploy new content for the policy it holds under name. An unknown name returns not_found. Never replay after reconnect.",
      "description": "AIDE \u2192 Frontend. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/backend/messages/policy_update"
        }
      ],
      "tags": [
        {
          "name": "AIDE \u2192 Frontend"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/backend"
        },
        "messages": [
          {
            "$ref": "#/channels/backend/messages/policy_update_result"
          },
          {
            "$ref": "#/channels/backend/messages/error"
          }
        ]
      }
    },
    "backend_policy_list": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/backend"
      },
      "title": "policy.list",
      "summary": "Ask the frontend which policies it holds in scope. Returns the name and deployed version of each. Read-only: safe to send again after reconnect.",
      "description": "AIDE \u2192 Frontend. Every defined request may return a correlated unsupported error. Commands request action; they do not directly mutate receiver-owned state.",
      "messages": [
        {
          "$ref": "#/channels/backend/messages/policy_list"
        }
      ],
      "tags": [
        {
          "name": "AIDE \u2192 Frontend"
        }
      ],
      "reply": {
        "channel": {
          "$ref": "#/channels/backend"
        },
        "messages": [
          {
            "$ref": "#/channels/backend/messages/policy_list_result"
          },
          {
            "$ref": "#/channels/backend/messages/error"
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "Audio": {
        "description": "Data about a previous audio response from the model.\n[Learn more](https://platform.openai.com/docs/guides/audio).",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "title": "Audio",
        "type": "object"
      },
      "ChatCompletionAssistantMessageParam": {
        "description": "Messages sent by the model in response to user messages.",
        "properties": {
          "role": {
            "const": "assistant",
            "title": "Role",
            "type": "string"
          },
          "audio": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Audio"
              },
              {
                "type": "null"
              }
            ]
          },
          "content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ChatCompletionContentPartTextParam"
                    },
                    {
                      "$ref": "#/components/schemas/ChatCompletionContentPartRefusalParam"
                    }
                  ]
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Content"
          },
          "function_call": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FunctionCall"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "refusal": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Refusal"
          },
          "tool_calls": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/ChatCompletionMessageFunctionToolCallParam"
                },
                {
                  "$ref": "#/components/schemas/ChatCompletionMessageCustomToolCallParam"
                }
              ]
            },
            "title": "Tool Calls",
            "type": "array"
          }
        },
        "required": [
          "role"
        ],
        "title": "ChatCompletionAssistantMessageParam",
        "type": "object"
      },
      "ChatCompletionChunk": {
        "additionalProperties": true,
        "description": "Represents a streamed chunk of a chat completion response returned\nby the model, based on the provided input.\n[Learn more](https://platform.openai.com/docs/guides/streaming-responses).",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "choices": {
            "items": {
              "$ref": "#/components/schemas/Choice"
            },
            "title": "Choices",
            "type": "array"
          },
          "created": {
            "title": "Created",
            "type": "integer"
          },
          "model": {
            "title": "Model",
            "type": "string"
          },
          "object": {
            "const": "chat.completion.chunk",
            "title": "Object",
            "type": "string"
          },
          "moderation": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Moderation"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "service_tier": {
            "anyOf": [
              {
                "enum": [
                  "auto",
                  "default",
                  "flex",
                  "scale",
                  "priority",
                  "fast"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Service Tier"
          },
          "system_fingerprint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "System Fingerprint"
          },
          "usage": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CompletionUsage"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          }
        },
        "required": [
          "id",
          "choices",
          "created",
          "model",
          "object"
        ],
        "title": "ChatCompletionChunk",
        "type": "object"
      },
      "ChatCompletionContentPartImageParam": {
        "description": "Learn about [image inputs](https://platform.openai.com/docs/guides/vision).",
        "properties": {
          "image_url": {
            "$ref": "#/components/schemas/ImageURL"
          },
          "type": {
            "const": "image_url",
            "title": "Type",
            "type": "string"
          },
          "prompt_cache_breakpoint": {
            "$ref": "#/components/schemas/PromptCacheBreakpoint"
          }
        },
        "required": [
          "image_url",
          "type"
        ],
        "title": "ChatCompletionContentPartImageParam",
        "type": "object"
      },
      "ChatCompletionContentPartInputAudioParam": {
        "description": "Learn about [audio inputs](https://platform.openai.com/docs/guides/audio).",
        "properties": {
          "input_audio": {
            "$ref": "#/components/schemas/InputAudio"
          },
          "type": {
            "const": "input_audio",
            "title": "Type",
            "type": "string"
          },
          "prompt_cache_breakpoint": {
            "$ref": "#/components/schemas/PromptCacheBreakpoint"
          }
        },
        "required": [
          "input_audio",
          "type"
        ],
        "title": "ChatCompletionContentPartInputAudioParam",
        "type": "object"
      },
      "ChatCompletionContentPartRefusalParam": {
        "properties": {
          "refusal": {
            "title": "Refusal",
            "type": "string"
          },
          "type": {
            "const": "refusal",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "refusal",
          "type"
        ],
        "title": "ChatCompletionContentPartRefusalParam",
        "type": "object"
      },
      "ChatCompletionContentPartTextParam": {
        "description": "Learn about [text inputs](https://platform.openai.com/docs/guides/text-generation).",
        "properties": {
          "text": {
            "title": "Text",
            "type": "string"
          },
          "type": {
            "const": "text",
            "title": "Type",
            "type": "string"
          },
          "prompt_cache_breakpoint": {
            "$ref": "#/components/schemas/PromptCacheBreakpoint"
          }
        },
        "required": [
          "text",
          "type"
        ],
        "title": "ChatCompletionContentPartTextParam",
        "type": "object"
      },
      "ChatCompletionDeveloperMessageParam": {
        "description": "Developer-provided instructions that the model should follow, regardless of\nmessages sent by the user. With o1 models and newer, `developer` messages\nreplace the previous `system` messages.",
        "properties": {
          "content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "$ref": "#/components/schemas/ChatCompletionContentPartTextParam"
                },
                "type": "array"
              }
            ],
            "title": "Content"
          },
          "role": {
            "const": "developer",
            "title": "Role",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "content",
          "role"
        ],
        "title": "ChatCompletionDeveloperMessageParam",
        "type": "object"
      },
      "ChatCompletionFunctionMessageParam": {
        "properties": {
          "content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Content"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "role": {
            "const": "function",
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "content",
          "name",
          "role"
        ],
        "title": "ChatCompletionFunctionMessageParam",
        "type": "object"
      },
      "ChatCompletionMessageCustomToolCallParam": {
        "description": "A call to a custom tool created by the model.",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "custom": {
            "$ref": "#/components/schemas/Custom"
          },
          "type": {
            "const": "custom",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "id",
          "custom",
          "type"
        ],
        "title": "ChatCompletionMessageCustomToolCallParam",
        "type": "object"
      },
      "ChatCompletionMessageFunctionToolCallParam": {
        "description": "A call to a function tool created by the model.",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "function": {
            "$ref": "#/components/schemas/Function"
          },
          "type": {
            "const": "function",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "id",
          "function",
          "type"
        ],
        "title": "ChatCompletionMessageFunctionToolCallParam",
        "type": "object"
      },
      "ChatCompletionSystemMessageParam": {
        "description": "Developer-provided instructions that the model should follow, regardless of\nmessages sent by the user. With o1 models and newer, use `developer` messages\nfor this purpose instead.",
        "properties": {
          "content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "$ref": "#/components/schemas/ChatCompletionContentPartTextParam"
                },
                "type": "array"
              }
            ],
            "title": "Content"
          },
          "role": {
            "const": "system",
            "title": "Role",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "content",
          "role"
        ],
        "title": "ChatCompletionSystemMessageParam",
        "type": "object"
      },
      "ChatCompletionTokenLogprob": {
        "additionalProperties": true,
        "properties": {
          "token": {
            "title": "Token",
            "type": "string"
          },
          "bytes": {
            "anyOf": [
              {
                "items": {
                  "type": "integer"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Bytes"
          },
          "logprob": {
            "title": "Logprob",
            "type": "number"
          },
          "top_logprobs": {
            "items": {
              "$ref": "#/components/schemas/TopLogprob"
            },
            "title": "Top Logprobs",
            "type": "array"
          }
        },
        "required": [
          "token",
          "logprob",
          "top_logprobs"
        ],
        "title": "ChatCompletionTokenLogprob",
        "type": "object"
      },
      "ChatCompletionToolMessageParam": {
        "properties": {
          "content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "$ref": "#/components/schemas/ChatCompletionContentPartTextParam"
                },
                "type": "array"
              }
            ],
            "title": "Content"
          },
          "role": {
            "const": "tool",
            "title": "Role",
            "type": "string"
          },
          "tool_call_id": {
            "title": "Tool Call Id",
            "type": "string"
          }
        },
        "required": [
          "content",
          "role",
          "tool_call_id"
        ],
        "title": "ChatCompletionToolMessageParam",
        "type": "object"
      },
      "ChatCompletionUserMessageParam": {
        "description": "Messages sent by an end user, containing prompts or additional context\ninformation.",
        "properties": {
          "content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ChatCompletionContentPartTextParam"
                    },
                    {
                      "$ref": "#/components/schemas/ChatCompletionContentPartImageParam"
                    },
                    {
                      "$ref": "#/components/schemas/ChatCompletionContentPartInputAudioParam"
                    },
                    {
                      "$ref": "#/components/schemas/File"
                    }
                  ]
                },
                "type": "array"
              }
            ],
            "title": "Content"
          },
          "role": {
            "const": "user",
            "title": "Role",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "content",
          "role"
        ],
        "title": "ChatCompletionUserMessageParam",
        "type": "object"
      },
      "Choice": {
        "additionalProperties": true,
        "properties": {
          "delta": {
            "$ref": "#/components/schemas/ChoiceDelta"
          },
          "finish_reason": {
            "anyOf": [
              {
                "enum": [
                  "stop",
                  "length",
                  "tool_calls",
                  "content_filter",
                  "function_call"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Finish Reason"
          },
          "index": {
            "title": "Index",
            "type": "integer"
          },
          "logprobs": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ChoiceLogprobs"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          }
        },
        "required": [
          "delta",
          "index"
        ],
        "title": "Choice",
        "type": "object"
      },
      "ChoiceDelta": {
        "additionalProperties": true,
        "description": "A chat completion delta generated by streamed model responses.",
        "properties": {
          "content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Content"
          },
          "function_call": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ChoiceDeltaFunctionCall"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "refusal": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Refusal"
          },
          "role": {
            "anyOf": [
              {
                "enum": [
                  "developer",
                  "system",
                  "user",
                  "assistant",
                  "tool"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Role"
          },
          "tool_calls": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ChoiceDeltaToolCall"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Tool Calls"
          }
        },
        "title": "ChoiceDelta",
        "type": "object"
      },
      "ChoiceDeltaFunctionCall": {
        "additionalProperties": true,
        "description": "Deprecated and replaced by `tool_calls`.\n\nThe name and arguments of a function that should be called, as generated by the model.",
        "properties": {
          "arguments": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Arguments"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Name"
          }
        },
        "title": "ChoiceDeltaFunctionCall",
        "type": "object"
      },
      "ChoiceDeltaToolCall": {
        "additionalProperties": true,
        "properties": {
          "index": {
            "title": "Index",
            "type": "integer"
          },
          "id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Id"
          },
          "function": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ChoiceDeltaToolCallFunction"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "type": {
            "anyOf": [
              {
                "const": "function",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Type"
          }
        },
        "required": [
          "index"
        ],
        "title": "ChoiceDeltaToolCall",
        "type": "object"
      },
      "ChoiceDeltaToolCallFunction": {
        "additionalProperties": true,
        "properties": {
          "arguments": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Arguments"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Name"
          }
        },
        "title": "ChoiceDeltaToolCallFunction",
        "type": "object"
      },
      "ChoiceLogprobs": {
        "additionalProperties": true,
        "description": "Log probability information for the choice.",
        "properties": {
          "content": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ChatCompletionTokenLogprob"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Content"
          },
          "refusal": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ChatCompletionTokenLogprob"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Refusal"
          }
        },
        "title": "ChoiceLogprobs",
        "type": "object"
      },
      "CompletionTokensDetails": {
        "additionalProperties": true,
        "description": "Breakdown of tokens used in a completion.",
        "properties": {
          "accepted_prediction_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Accepted Prediction Tokens"
          },
          "audio_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Audio Tokens"
          },
          "reasoning_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Reasoning Tokens"
          },
          "rejected_prediction_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Rejected Prediction Tokens"
          }
        },
        "title": "CompletionTokensDetails",
        "type": "object"
      },
      "CompletionUsage": {
        "additionalProperties": true,
        "description": "Usage statistics for the completion request.",
        "properties": {
          "completion_tokens": {
            "title": "Completion Tokens",
            "type": "integer"
          },
          "prompt_tokens": {
            "title": "Prompt Tokens",
            "type": "integer"
          },
          "total_tokens": {
            "title": "Total Tokens",
            "type": "integer"
          },
          "completion_tokens_details": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CompletionTokensDetails"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "prompt_tokens_details": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PromptTokensDetails"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          }
        },
        "required": [
          "completion_tokens",
          "prompt_tokens",
          "total_tokens"
        ],
        "title": "CompletionUsage",
        "type": "object"
      },
      "Custom": {
        "description": "The custom tool that the model called.",
        "properties": {
          "input": {
            "title": "Input",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "input",
          "name"
        ],
        "title": "Custom",
        "type": "object"
      },
      "File": {
        "description": "Learn about [file inputs](https://platform.openai.com/docs/guides/text) for text generation.",
        "properties": {
          "file": {
            "$ref": "#/components/schemas/FileFile"
          },
          "type": {
            "const": "file",
            "title": "Type",
            "type": "string"
          },
          "prompt_cache_breakpoint": {
            "$ref": "#/components/schemas/FilePromptCacheBreakpoint"
          }
        },
        "required": [
          "file",
          "type"
        ],
        "title": "File",
        "type": "object"
      },
      "FileFile": {
        "properties": {
          "file_data": {
            "title": "File Data",
            "type": "string"
          },
          "file_id": {
            "title": "File Id",
            "type": "string"
          },
          "filename": {
            "title": "Filename",
            "type": "string"
          }
        },
        "title": "FileFile",
        "type": "object"
      },
      "FilePromptCacheBreakpoint": {
        "description": "Marks the exact end of a reusable prompt prefix.\n\nThe breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.",
        "properties": {
          "mode": {
            "const": "explicit",
            "title": "Mode",
            "type": "string"
          }
        },
        "required": [
          "mode"
        ],
        "title": "FilePromptCacheBreakpoint",
        "type": "object"
      },
      "Function": {
        "description": "The function that the model called.",
        "properties": {
          "arguments": {
            "title": "Arguments",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "arguments",
          "name"
        ],
        "title": "Function",
        "type": "object"
      },
      "FunctionCall": {
        "description": "Deprecated and replaced by `tool_calls`.\n\nThe name and arguments of a function that should be called, as generated by the model.",
        "properties": {
          "arguments": {
            "title": "Arguments",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "arguments",
          "name"
        ],
        "title": "FunctionCall",
        "type": "object"
      },
      "ImageURL": {
        "properties": {
          "url": {
            "title": "Url",
            "type": "string"
          },
          "detail": {
            "enum": [
              "auto",
              "low",
              "high"
            ],
            "title": "Detail",
            "type": "string"
          }
        },
        "required": [
          "url"
        ],
        "title": "ImageURL",
        "type": "object"
      },
      "InputAudio": {
        "properties": {
          "data": {
            "title": "Data",
            "type": "string"
          },
          "format": {
            "enum": [
              "wav",
              "mp3"
            ],
            "title": "Format",
            "type": "string"
          }
        },
        "required": [
          "data",
          "format"
        ],
        "title": "InputAudio",
        "type": "object"
      },
      "Moderation": {
        "additionalProperties": true,
        "description": "Moderation results for the request input and generated output.\n\nPresent\non the moderation chunk when moderated completions are requested.",
        "properties": {
          "input": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ModerationInputModerationResults"
              },
              {
                "$ref": "#/components/schemas/ModerationInputError"
              }
            ],
            "title": "Input"
          },
          "output": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ModerationOutputModerationResults"
              },
              {
                "$ref": "#/components/schemas/ModerationOutputError"
              }
            ],
            "title": "Output"
          }
        },
        "required": [
          "input",
          "output"
        ],
        "title": "Moderation",
        "type": "object"
      },
      "ModerationInputError": {
        "additionalProperties": true,
        "description": "An error produced while attempting moderation.",
        "properties": {
          "code": {
            "title": "Code",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "const": "error",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "code",
          "message",
          "type"
        ],
        "title": "ModerationInputError",
        "type": "object"
      },
      "ModerationInputModerationResults": {
        "additionalProperties": true,
        "description": "Successful moderation results for the request input or generated output.",
        "properties": {
          "model": {
            "title": "Model",
            "type": "string"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/ModerationInputModerationResultsResult"
            },
            "title": "Results",
            "type": "array"
          },
          "type": {
            "const": "moderation_results",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "model",
          "results",
          "type"
        ],
        "title": "ModerationInputModerationResults",
        "type": "object"
      },
      "ModerationInputModerationResultsResult": {
        "additionalProperties": true,
        "description": "A moderation result produced for the response input or output.",
        "properties": {
          "categories": {
            "additionalProperties": {
              "type": "boolean"
            },
            "title": "Categories",
            "type": "object"
          },
          "category_applied_input_types": {
            "additionalProperties": {
              "items": {
                "enum": [
                  "text",
                  "image"
                ],
                "type": "string"
              },
              "type": "array"
            },
            "title": "Category Applied Input Types",
            "type": "object"
          },
          "category_scores": {
            "additionalProperties": {
              "type": "number"
            },
            "title": "Category Scores",
            "type": "object"
          },
          "flagged": {
            "title": "Flagged",
            "type": "boolean"
          },
          "model": {
            "title": "Model",
            "type": "string"
          },
          "type": {
            "const": "moderation_result",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "categories",
          "category_applied_input_types",
          "category_scores",
          "flagged",
          "model",
          "type"
        ],
        "title": "ModerationInputModerationResultsResult",
        "type": "object"
      },
      "ModerationOutputError": {
        "additionalProperties": true,
        "description": "An error produced while attempting moderation.",
        "properties": {
          "code": {
            "title": "Code",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "const": "error",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "code",
          "message",
          "type"
        ],
        "title": "ModerationOutputError",
        "type": "object"
      },
      "ModerationOutputModerationResults": {
        "additionalProperties": true,
        "description": "Successful moderation results for the request input or generated output.",
        "properties": {
          "model": {
            "title": "Model",
            "type": "string"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/ModerationOutputModerationResultsResult"
            },
            "title": "Results",
            "type": "array"
          },
          "type": {
            "const": "moderation_results",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "model",
          "results",
          "type"
        ],
        "title": "ModerationOutputModerationResults",
        "type": "object"
      },
      "ModerationOutputModerationResultsResult": {
        "additionalProperties": true,
        "description": "A moderation result produced for the response input or output.",
        "properties": {
          "categories": {
            "additionalProperties": {
              "type": "boolean"
            },
            "title": "Categories",
            "type": "object"
          },
          "category_applied_input_types": {
            "additionalProperties": {
              "items": {
                "enum": [
                  "text",
                  "image"
                ],
                "type": "string"
              },
              "type": "array"
            },
            "title": "Category Applied Input Types",
            "type": "object"
          },
          "category_scores": {
            "additionalProperties": {
              "type": "number"
            },
            "title": "Category Scores",
            "type": "object"
          },
          "flagged": {
            "title": "Flagged",
            "type": "boolean"
          },
          "model": {
            "title": "Model",
            "type": "string"
          },
          "type": {
            "const": "moderation_result",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "categories",
          "category_applied_input_types",
          "category_scores",
          "flagged",
          "model",
          "type"
        ],
        "title": "ModerationOutputModerationResultsResult",
        "type": "object"
      },
      "PromptCacheBreakpoint": {
        "description": "Marks the exact end of a reusable prompt prefix.\n\nThe breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.",
        "properties": {
          "mode": {
            "const": "explicit",
            "title": "Mode",
            "type": "string"
          }
        },
        "required": [
          "mode"
        ],
        "title": "PromptCacheBreakpoint",
        "type": "object"
      },
      "PromptTokensDetails": {
        "additionalProperties": true,
        "description": "Breakdown of tokens used in the prompt.",
        "properties": {
          "audio_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Audio Tokens"
          },
          "cache_write_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Cache Write Tokens"
          },
          "cached_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Cached Tokens"
          }
        },
        "title": "PromptTokensDetails",
        "type": "object"
      },
      "TopLogprob": {
        "additionalProperties": true,
        "properties": {
          "token": {
            "title": "Token",
            "type": "string"
          },
          "bytes": {
            "anyOf": [
              {
                "items": {
                  "type": "integer"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Bytes"
          },
          "logprob": {
            "title": "Logprob",
            "type": "number"
          }
        },
        "required": [
          "token",
          "logprob"
        ],
        "title": "TopLogprob",
        "type": "object"
      },
      "ChatCompletionMessageParam": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/ChatCompletionDeveloperMessageParam"
          },
          {
            "$ref": "#/components/schemas/ChatCompletionSystemMessageParam"
          },
          {
            "$ref": "#/components/schemas/ChatCompletionUserMessageParam"
          },
          {
            "$ref": "#/components/schemas/ChatCompletionAssistantMessageParam"
          },
          {
            "$ref": "#/components/schemas/ChatCompletionToolMessageParam"
          },
          {
            "$ref": "#/components/schemas/ChatCompletionFunctionMessageParam"
          }
        ]
      },
      "PendingInput": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "request_id": {
                "type": "string",
                "format": "uuid"
              },
              "task_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "prompt": {
                "type": "string"
              },
              "kind": {
                "enum": [
                  "approval"
                ]
              },
              "choices": {
                "type": "array",
                "items": {
                  "enum": [
                    "once",
                    "deny"
                  ]
                },
                "minItems": 1,
                "uniqueItems": true
              },
              "description": {
                "type": "string",
                "description": "What the action does, in words."
              },
              "command": {
                "type": "string",
                "description": "The exact command to approve, shown verbatim."
              }
            },
            "required": [
              "request_id",
              "prompt",
              "kind",
              "choices"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "request_id": {
                "type": "string",
                "format": "uuid"
              },
              "task_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "prompt": {
                "type": "string"
              },
              "kind": {
                "enum": [
                  "clarification"
                ]
              }
            },
            "required": [
              "request_id",
              "prompt",
              "kind"
            ],
            "additionalProperties": false,
            "deprecated": true,
            "description": "Deprecated: AIDE asks questions with clarification.request instead. Producers stop emitting this kind; it stays valid until no runtime emits it."
          }
        ]
      },
      "InputResponse": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "kind": {
                "enum": [
                  "approval"
                ]
              },
              "choice": {
                "enum": [
                  "once",
                  "deny"
                ]
              }
            },
            "required": [
              "kind",
              "choice"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "enum": [
                  "clarification"
                ]
              },
              "answer": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "kind",
              "answer"
            ],
            "additionalProperties": false,
            "deprecated": true,
            "description": "Deprecated: answers only a deprecated clarification pending input. Answer a clarification.request with clarification.response."
          }
        ]
      },
      "Session": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "parent_session_id": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "title": {
            "type": "string"
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "ended_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "active_request_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "uniqueItems": true
          },
          "pending": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PendingInput"
            }
          },
          "scope": {
            "$ref": "#/components/schemas/Scope"
          },
          "revision": {
            "type": "integer",
            "minimum": 0,
            "description": "Durable revision of this record: the workspace store sequence of its latest change. Larger is newer; it survives backend restarts."
          },
          "requests": {
            "type": "array",
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/ChatRequest"
                },
                {
                  "not": {
                    "anyOf": [
                      {
                        "required": [
                          "messages"
                        ]
                      },
                      {
                        "required": [
                          "message_omitted"
                        ]
                      }
                    ]
                  }
                }
              ]
            },
            "description": "Up to 1000 non-terminal requests of this session plus its 10 most recently updated terminal ones, ordered by created_at, oldest first, without messages. active_request_ids lists every non-terminal request, so it can name requests this list omits; read state.list requests for the rest.",
            "maxItems": 1010
          },
          "source": {
            "$ref": "#/components/schemas/Source"
          }
        },
        "required": [
          "id",
          "parent_session_id",
          "started_at",
          "ended_at",
          "active_request_ids",
          "pending",
          "scope"
        ],
        "additionalProperties": false
      },
      "Task": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "scope_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "goal_id": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "depends_on": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Direct prerequisites, using task IDs in the same scope. An empty array means the task has no prerequisites."
          },
          "session_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "status": {
            "enum": [
              "proposed",
              "pending",
              "in_progress",
              "completed",
              "abandoned"
            ]
          },
          "priority": {
            "enum": [
              "normal",
              "high"
            ],
            "description": "The workspace's scheduling priority for this task."
          },
          "outcome": {
            "anyOf": [
              {
                "enum": [
                  "succeeded",
                  "failed",
                  "inconclusive",
                  "abandoned"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "waiting_on": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "detail": {
                    "type": "string"
                  }
                },
                "required": [
                  "detail"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer",
            "minimum": 0,
            "description": "Durable revision of this record: the workspace store sequence of its latest change. Larger is newer; it survives backend restarts."
          }
        },
        "required": [
          "id",
          "scope_id",
          "goal_id",
          "session_ids",
          "title",
          "description",
          "summary",
          "status",
          "outcome",
          "waiting_on"
        ],
        "additionalProperties": false
      },
      "Goal": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "scope_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "end_state": {
            "type": "string"
          },
          "status": {
            "enum": [
              "active",
              "parked",
              "completed",
              "abandoned"
            ]
          },
          "summary": {
            "type": "string"
          },
          "revision": {
            "type": "integer",
            "minimum": 0,
            "description": "Durable revision of this record: the workspace store sequence of its latest change. Larger is newer; it survives backend restarts."
          }
        },
        "required": [
          "id",
          "scope_id",
          "title",
          "description",
          "end_state",
          "status",
          "summary"
        ],
        "additionalProperties": false
      },
      "MessageRecord": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "session_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "request_id": {
            "type": "string",
            "format": "uuid"
          },
          "sequence": {
            "type": "integer",
            "minimum": 1
          },
          "message": {
            "$ref": "#/components/schemas/ChatCompletionMessageParam"
          },
          "kind": {
            "enum": [
              "message",
              "continuation",
              "failed_turn"
            ],
            "description": "message: conversation content. continuation: a user-role prompt written to continue an earlier request, such as AIDE's resume prompt after a hold; not typed by the user. failed_turn: an assistant-role runtime notice about a failed turn that the request record already reports. Frontends normally hide continuation and failed_turn. Absent means message."
          },
          "reasoning": {
            "type": "string",
            "description": "The model's retained reasoning for an assistant message."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "scope": {
            "$ref": "#/components/schemas/Scope"
          }
        },
        "required": [
          "id",
          "session_id",
          "sequence",
          "message"
        ],
        "additionalProperties": false
      },
      "ErrorClass": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200,
        "description": "Open classification of a model-work failure. Documented values: budget_exhausted, rate_limited, provider_unavailable (these pass on their own: the request waits and resumes), too_large (the conversation no longer fits), misconfigured (the workspace's model setup is broken). Treat unknown values as a generic failure."
      },
      "Cursor": {
        "type": "object",
        "description": "Position in a request's progress. attempt counts the request's durable resumes (0 for its first run); seq is the run's own event sequence. Cursors order by attempt, then seq; {attempt:n, seq:0} is the start of attempt n.",
        "properties": {
          "attempt": {
            "type": "integer",
            "minimum": 0
          },
          "seq": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "attempt",
          "seq"
        ],
        "additionalProperties": false
      },
      "RequestWaiting": {
        "type": "object",
        "description": "Why a waiting request is held and when AIDE resumes it. Do not read the request before until; after it, one read wakes the workspace.",
        "properties": {
          "reason": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ErrorClass"
              },
              {
                "type": "null"
              }
            ]
          },
          "until": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Earliest resume time. A budget hold can last past it, until new budget arrives."
          }
        },
        "required": [
          "reason",
          "until"
        ],
        "additionalProperties": false
      },
      "RequestError": {
        "type": "object",
        "description": "Why a request failed. code is a stable identifier; message is human-readable detail and is not parsed; class is the classified cause when known.",
        "properties": {
          "class": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ErrorClass"
              },
              {
                "type": "null"
              }
            ]
          },
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Stable identifier, for example the class or interrupted."
          },
          "message": {
            "type": "string",
            "maxLength": 4000
          }
        },
        "required": [
          "code",
          "message"
        ],
        "additionalProperties": false
      },
      "ChatRequest": {
        "type": "object",
        "description": "Durable record of one unit of chat work in a session: a chat.send, or work AIDE started itself. Read it as resource requests; sessions embed their recent ones.",
        "properties": {
          "request_id": {
            "type": "string",
            "format": "uuid",
            "description": "The chat.send request ID, or a UUID AIDE chose for runtime work. chat.cancel and chat.events take it."
          },
          "session_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "scope": {
            "$ref": "#/components/schemas/Scope"
          },
          "origin": {
            "enum": [
              "user",
              "runtime"
            ],
            "description": "user: a chat.send. runtime: work AIDE started without one, such as a continuation or wake run. Both can be cancelled and can hold pending inputs."
          },
          "status": {
            "enum": [
              "queued",
              "running",
              "waiting",
              "completed",
              "cancelled",
              "failed",
              "interrupted"
            ],
            "description": "queued until work starts, then running. waiting: held after a budget, rate-limit or provider failure; AIDE resumes it without the frontend; never resend it. Terminal: completed, cancelled, failed, interrupted (a workspace restart or crash stopped it; some actions may have run)."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Session.requests is ordered by created_at, oldest first; state.list requests newest first."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "revision": {
            "type": "integer",
            "minimum": 0,
            "description": "Durable revision of this record: the workspace store sequence of its latest change. Larger is newer; it survives backend restarts."
          },
          "attempt": {
            "type": "integer",
            "minimum": 0,
            "description": "The current attempt: read chat.events from {attempt, seq:0} when no newer cursor is known."
          },
          "in_history": {
            "type": "boolean",
            "description": "Whether chat.history holds this request's messages. False before work starts and after a request ends without starting; read the request for its messages."
          },
          "error": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RequestError"
              },
              {
                "type": "null"
              }
            ],
            "description": "Non-null exactly when status is failed or interrupted."
          },
          "waiting": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RequestWaiting"
              },
              {
                "type": "null"
              }
            ],
            "description": "Non-null exactly when status is waiting."
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChatCompletionMessageParam"
            },
            "minItems": 1,
            "description": "The chat.send messages. Only state.get returns them, and only while in_history is false. A retry resends them under a new request ID."
          },
          "message_omitted": {
            "const": true,
            "description": "Replaces messages when they would not fit the message limit."
          }
        },
        "required": [
          "request_id",
          "session_id",
          "scope",
          "origin",
          "status",
          "created_at",
          "updated_at",
          "revision",
          "attempt",
          "in_history",
          "error",
          "waiting"
        ],
        "additionalProperties": false,
        "allOf": [
          {
            "if": {
              "properties": {
                "status": {
                  "const": "waiting"
                }
              }
            },
            "then": {
              "properties": {
                "waiting": {
                  "$ref": "#/components/schemas/RequestWaiting"
                }
              }
            },
            "else": {
              "properties": {
                "waiting": {
                  "type": "null"
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "status": {
                  "enum": [
                    "failed",
                    "interrupted"
                  ]
                }
              }
            },
            "then": {
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/RequestError"
                }
              }
            },
            "else": {
              "properties": {
                "error": {
                  "type": "null"
                }
              }
            }
          },
          {
            "not": {
              "required": [
                "messages",
                "message_omitted"
              ]
            }
          },
          {
            "if": {
              "properties": {
                "in_history": {
                  "const": true
                }
              }
            },
            "then": {
              "not": {
                "anyOf": [
                  {
                    "required": [
                      "messages"
                    ]
                  },
                  {
                    "required": [
                      "message_omitted"
                    ]
                  }
                ]
              }
            }
          },
          {
            "if": {
              "properties": {
                "origin": {
                  "const": "runtime"
                }
              }
            },
            "then": {
              "not": {
                "anyOf": [
                  {
                    "required": [
                      "messages"
                    ]
                  },
                  {
                    "required": [
                      "message_omitted"
                    ]
                  }
                ]
              }
            }
          }
        ]
      },
      "ChatEvent": {
        "description": "One progress event of a chat request at cursor {attempt, seq}. seq starts at 1 in each attempt and increases by exactly one per event; events the runtime cannot place are folded into the next event or dropped before seq is assigned. chat.events reads these events and chat.event pushes the same events with the same cursors.",
        "oneOf": [
          {
            "type": "object",
            "description": "Streamed assistant text.",
            "properties": {
              "attempt": {
                "type": "integer",
                "minimum": 0
              },
              "seq": {
                "type": "integer",
                "minimum": 1
              },
              "at": {
                "type": "string",
                "format": "date-time"
              },
              "kind": {
                "const": "text.delta"
              },
              "completion_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "delta": {
                "type": "string"
              }
            },
            "required": [
              "attempt",
              "seq",
              "at",
              "kind",
              "completion_id",
              "delta"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "description": "Interim assistant text between tool calls. already_streamed: text.delta events already carried it.",
            "properties": {
              "attempt": {
                "type": "integer",
                "minimum": 0
              },
              "seq": {
                "type": "integer",
                "minimum": 1
              },
              "at": {
                "type": "string",
                "format": "date-time"
              },
              "kind": {
                "const": "text.interim"
              },
              "text": {
                "type": "string"
              },
              "already_streamed": {
                "type": "boolean"
              },
              "truncated": {
                "const": true,
                "description": "text was cut to fit the message limit."
              }
            },
            "required": [
              "attempt",
              "seq",
              "at",
              "kind",
              "text",
              "already_streamed"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "description": "The model is reasoning; text when the model exposes it.",
            "properties": {
              "attempt": {
                "type": "integer",
                "minimum": 0
              },
              "seq": {
                "type": "integer",
                "minimum": 1
              },
              "at": {
                "type": "string",
                "format": "date-time"
              },
              "kind": {
                "const": "reasoning"
              },
              "text": {
                "type": "string"
              },
              "truncated": {
                "const": true,
                "description": "text was cut to fit the message limit."
              }
            },
            "required": [
              "attempt",
              "seq",
              "at",
              "kind"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "description": "A backend tool call started. It never asks the frontend to run anything.",
            "properties": {
              "attempt": {
                "type": "integer",
                "minimum": 0
              },
              "seq": {
                "type": "integer",
                "minimum": 1
              },
              "at": {
                "type": "string",
                "format": "date-time"
              },
              "kind": {
                "const": "tool.started"
              },
              "call_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "arguments": {
                "type": "string",
                "description": "The call arguments as JSON text."
              },
              "truncated": {
                "const": true,
                "description": "arguments was cut to fit the message limit and is not valid JSON; display only."
              }
            },
            "required": [
              "attempt",
              "seq",
              "at",
              "kind",
              "call_id",
              "name",
              "arguments"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "description": "A backend tool call finished; its result is in chat.history.",
            "properties": {
              "attempt": {
                "type": "integer",
                "minimum": 0
              },
              "seq": {
                "type": "integer",
                "minimum": 1
              },
              "at": {
                "type": "string",
                "format": "date-time"
              },
              "kind": {
                "const": "tool.completed"
              },
              "call_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              }
            },
            "required": [
              "attempt",
              "seq",
              "at",
              "kind",
              "call_id",
              "name"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "description": "The request's terminal outcome. Always its last event.",
            "properties": {
              "attempt": {
                "type": "integer",
                "minimum": 0
              },
              "seq": {
                "type": "integer",
                "minimum": 1
              },
              "at": {
                "type": "string",
                "format": "date-time"
              },
              "kind": {
                "const": "finished"
              },
              "status": {
                "enum": [
                  "completed",
                  "cancelled",
                  "failed",
                  "interrupted"
                ]
              },
              "error": {
                "$ref": "#/components/schemas/RequestError"
              }
            },
            "required": [
              "attempt",
              "seq",
              "at",
              "kind",
              "status"
            ],
            "additionalProperties": false,
            "allOf": [
              {
                "if": {
                  "properties": {
                    "status": {
                      "enum": [
                        "failed",
                        "interrupted"
                      ]
                    }
                  }
                },
                "then": {
                  "required": [
                    "error"
                  ]
                },
                "else": {
                  "not": {
                    "required": [
                      "error"
                    ]
                  }
                }
              }
            ]
          }
        ]
      },
      "Client": {
        "type": "object",
        "description": "The frontend that opened a session (legacy parity). AIDE stamps it into every turn of that session.",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "description": "Stable frontend identity, for example a site or product id."
          },
          "kind": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40,
            "description": "Frontend kind, for example web."
          },
          "guide": {
            "type": "string",
            "maxLength": 64,
            "description": "Name of the agent guide skill for this frontend.",
            "minLength": 1
          }
        },
        "required": [
          "id",
          "kind"
        ],
        "additionalProperties": false
      },
      "DomNode": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "kind": {
                "enum": [
                  "text"
                ]
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "text": {
                "type": "string"
              }
            },
            "required": [
              "kind",
              "id",
              "text"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "enum": [
                  "element"
                ]
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "tag": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "attributes": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              },
              "children": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/DomNode"
                }
              },
              "value": {
                "type": "string"
              },
              "checked": {
                "type": "boolean"
              },
              "actions": {
                "type": "array",
                "items": {
                  "enum": [
                    "click",
                    "fill",
                    "highlight"
                  ]
                },
                "uniqueItems": true
              }
            },
            "required": [
              "kind",
              "id",
              "tag",
              "attributes",
              "children",
              "actions"
            ],
            "additionalProperties": false
          }
        ]
      },
      "BrowserSnapshot": {
        "type": "object",
        "properties": {
          "document_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "revision": {
            "type": "integer",
            "minimum": 0
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "title": {
            "type": "string"
          },
          "root": {
            "$ref": "#/components/schemas/DomNode"
          },
          "scope": {
            "$ref": "#/components/schemas/Scope"
          }
        },
        "required": [
          "document_id",
          "revision",
          "url",
          "title",
          "root"
        ],
        "additionalProperties": false
      },
      "BrowserAction": {
        "type": "object",
        "properties": {
          "document_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "revision": {
            "type": "integer",
            "minimum": 0
          },
          "node_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "action": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "enum": [
                      "click"
                    ]
                  }
                },
                "required": [
                  "kind"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "enum": [
                      "fill"
                    ]
                  },
                  "value": {
                    "type": "string"
                  }
                },
                "required": [
                  "kind",
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "enum": [
                      "highlight"
                    ]
                  },
                  "duration_ms": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 10000
                  }
                },
                "required": [
                  "kind",
                  "duration_ms"
                ],
                "additionalProperties": false
              }
            ]
          },
          "scope": {
            "$ref": "#/components/schemas/Scope"
          }
        },
        "required": [
          "document_id",
          "revision",
          "node_id",
          "expires_at",
          "action"
        ],
        "additionalProperties": false
      },
      "StateListResult": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "resource": {
                "enum": [
                  "sessions"
                ]
              },
              "epoch": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "revision": {
                "type": "integer",
                "minimum": 0
              },
              "items": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Session"
                }
              },
              "next_cursor": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "resource",
              "epoch",
              "revision",
              "items",
              "next_cursor"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "resource": {
                "enum": [
                  "tasks"
                ]
              },
              "epoch": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "revision": {
                "type": "integer",
                "minimum": 0
              },
              "items": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Task"
                }
              },
              "next_cursor": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "resource",
              "epoch",
              "revision",
              "items",
              "next_cursor"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "resource": {
                "enum": [
                  "goals"
                ]
              },
              "epoch": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "revision": {
                "type": "integer",
                "minimum": 0
              },
              "items": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Goal"
                }
              },
              "next_cursor": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "resource",
              "epoch",
              "revision",
              "items",
              "next_cursor"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "resource": {
                "enum": [
                  "requests"
                ]
              },
              "epoch": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "revision": {
                "type": "integer",
                "minimum": 0
              },
              "items": {
                "type": "array",
                "items": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ChatRequest"
                    },
                    {
                      "not": {
                        "anyOf": [
                          {
                            "required": [
                              "messages"
                            ]
                          },
                          {
                            "required": [
                              "message_omitted"
                            ]
                          }
                        ]
                      }
                    }
                  ]
                }
              },
              "next_cursor": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "resource",
              "epoch",
              "revision",
              "items",
              "next_cursor"
            ],
            "additionalProperties": false
          }
        ]
      },
      "StateGetResult": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "resource": {
                "enum": [
                  "sessions"
                ]
              },
              "epoch": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "revision": {
                "type": "integer",
                "minimum": 0
              },
              "item": {
                "$ref": "#/components/schemas/Session"
              }
            },
            "required": [
              "resource",
              "epoch",
              "revision",
              "item"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "resource": {
                "enum": [
                  "tasks"
                ]
              },
              "epoch": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "revision": {
                "type": "integer",
                "minimum": 0
              },
              "item": {
                "$ref": "#/components/schemas/Task"
              }
            },
            "required": [
              "resource",
              "epoch",
              "revision",
              "item"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "resource": {
                "enum": [
                  "goals"
                ]
              },
              "epoch": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "revision": {
                "type": "integer",
                "minimum": 0
              },
              "item": {
                "$ref": "#/components/schemas/Goal"
              }
            },
            "required": [
              "resource",
              "epoch",
              "revision",
              "item"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "resource": {
                "enum": [
                  "requests"
                ]
              },
              "epoch": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "revision": {
                "type": "integer",
                "minimum": 0
              },
              "item": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ChatRequest"
                  },
                  {
                    "if": {
                      "properties": {
                        "origin": {
                          "const": "user"
                        },
                        "in_history": {
                          "const": false
                        }
                      },
                      "required": [
                        "origin",
                        "in_history"
                      ]
                    },
                    "then": {
                      "anyOf": [
                        {
                          "required": [
                            "messages"
                          ]
                        },
                        {
                          "required": [
                            "message_omitted"
                          ]
                        }
                      ]
                    }
                  }
                ]
              }
            },
            "required": [
              "resource",
              "epoch",
              "revision",
              "item"
            ],
            "additionalProperties": false
          }
        ]
      },
      "StateChanged": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "resource": {
                "enum": [
                  "sessions"
                ]
              },
              "epoch": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "revision": {
                "type": "integer",
                "minimum": 0
              },
              "previous_revision": {
                "type": "integer",
                "minimum": 0
              },
              "change": {
                "enum": [
                  "upsert"
                ]
              },
              "item": {
                "$ref": "#/components/schemas/Session"
              },
              "scope": {
                "$ref": "#/components/schemas/Scope"
              }
            },
            "required": [
              "resource",
              "epoch",
              "revision",
              "previous_revision",
              "change",
              "item"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "resource": {
                "enum": [
                  "sessions"
                ]
              },
              "epoch": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "revision": {
                "type": "integer",
                "minimum": 0
              },
              "previous_revision": {
                "type": "integer",
                "minimum": 0
              },
              "change": {
                "enum": [
                  "delete"
                ]
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "scope": {
                "$ref": "#/components/schemas/Scope"
              }
            },
            "required": [
              "resource",
              "epoch",
              "revision",
              "previous_revision",
              "change",
              "id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "resource": {
                "enum": [
                  "sessions"
                ]
              },
              "epoch": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "revision": {
                "type": "integer",
                "minimum": 0
              },
              "previous_revision": {
                "type": "integer",
                "minimum": 0
              },
              "change": {
                "enum": [
                  "invalidate"
                ]
              },
              "scope": {
                "$ref": "#/components/schemas/Scope"
              }
            },
            "required": [
              "resource",
              "epoch",
              "revision",
              "previous_revision",
              "change"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "resource": {
                "enum": [
                  "tasks"
                ]
              },
              "epoch": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "revision": {
                "type": "integer",
                "minimum": 0
              },
              "previous_revision": {
                "type": "integer",
                "minimum": 0
              },
              "change": {
                "enum": [
                  "upsert"
                ]
              },
              "item": {
                "$ref": "#/components/schemas/Task"
              },
              "scope": {
                "$ref": "#/components/schemas/Scope"
              }
            },
            "required": [
              "resource",
              "epoch",
              "revision",
              "previous_revision",
              "change",
              "item"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "resource": {
                "enum": [
                  "tasks"
                ]
              },
              "epoch": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "revision": {
                "type": "integer",
                "minimum": 0
              },
              "previous_revision": {
                "type": "integer",
                "minimum": 0
              },
              "change": {
                "enum": [
                  "delete"
                ]
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "scope": {
                "$ref": "#/components/schemas/Scope"
              }
            },
            "required": [
              "resource",
              "epoch",
              "revision",
              "previous_revision",
              "change",
              "id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "resource": {
                "enum": [
                  "tasks"
                ]
              },
              "epoch": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "revision": {
                "type": "integer",
                "minimum": 0
              },
              "previous_revision": {
                "type": "integer",
                "minimum": 0
              },
              "change": {
                "enum": [
                  "invalidate"
                ]
              },
              "scope": {
                "$ref": "#/components/schemas/Scope"
              }
            },
            "required": [
              "resource",
              "epoch",
              "revision",
              "previous_revision",
              "change"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "resource": {
                "enum": [
                  "goals"
                ]
              },
              "epoch": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "revision": {
                "type": "integer",
                "minimum": 0
              },
              "previous_revision": {
                "type": "integer",
                "minimum": 0
              },
              "change": {
                "enum": [
                  "upsert"
                ]
              },
              "item": {
                "$ref": "#/components/schemas/Goal"
              },
              "scope": {
                "$ref": "#/components/schemas/Scope"
              }
            },
            "required": [
              "resource",
              "epoch",
              "revision",
              "previous_revision",
              "change",
              "item"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "resource": {
                "enum": [
                  "goals"
                ]
              },
              "epoch": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "revision": {
                "type": "integer",
                "minimum": 0
              },
              "previous_revision": {
                "type": "integer",
                "minimum": 0
              },
              "change": {
                "enum": [
                  "delete"
                ]
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "scope": {
                "$ref": "#/components/schemas/Scope"
              }
            },
            "required": [
              "resource",
              "epoch",
              "revision",
              "previous_revision",
              "change",
              "id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "resource": {
                "enum": [
                  "goals"
                ]
              },
              "epoch": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "revision": {
                "type": "integer",
                "minimum": 0
              },
              "previous_revision": {
                "type": "integer",
                "minimum": 0
              },
              "change": {
                "enum": [
                  "invalidate"
                ]
              },
              "scope": {
                "$ref": "#/components/schemas/Scope"
              }
            },
            "required": [
              "resource",
              "epoch",
              "revision",
              "previous_revision",
              "change"
            ],
            "additionalProperties": false
          }
        ]
      },
      "session_openParams": {
        "type": "object",
        "properties": {
          "scope": {
            "$ref": "#/components/schemas/Scope"
          },
          "client": {
            "$ref": "#/components/schemas/Client"
          },
          "source": {
            "$ref": "#/components/schemas/Source"
          }
        },
        "required": [
          "scope"
        ],
        "additionalProperties": false
      },
      "session_openResult": {
        "type": "object",
        "properties": {
          "session": {
            "$ref": "#/components/schemas/Session"
          }
        },
        "required": [
          "session"
        ],
        "additionalProperties": false
      },
      "chat_sendParams": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChatCompletionMessageParam"
            },
            "minItems": 1
          },
          "scope": {
            "$ref": "#/components/schemas/Scope"
          },
          "context": {
            "type": "object",
            "description": "Runtime-defined turn context (for example the page the user is looking at), passed to the workspace unchanged. The workspace validates and renders it; the platform does not interpret it."
          },
          "instructions": {
            "type": "string",
            "maxLength": 64000,
            "description": "Per-request guidance for the agent, kept out of the visible message; passed to the workspace unchanged."
          }
        },
        "required": [
          "session_id",
          "messages",
          "scope"
        ],
        "additionalProperties": false
      },
      "chat_sendResult": {
        "type": "object",
        "properties": {
          "accepted": {
            "enum": [
              true
            ]
          },
          "session_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "request_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "accepted",
          "session_id",
          "request_id"
        ],
        "additionalProperties": false
      },
      "state_listParams": {
        "type": "object",
        "properties": {
          "resource": {
            "enum": [
              "sessions",
              "tasks",
              "goals",
              "requests"
            ]
          },
          "scope_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "cursor": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "scope": {
            "$ref": "#/components/schemas/Scope"
          },
          "wake": {
            "type": "boolean",
            "description": "false: never wake a sleeping workspace for this read; the relay refuses it with asleep and outcome not_delivered instead. Default true."
          },
          "session_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Required for, and only valid with, resource requests."
          }
        },
        "required": [
          "resource"
        ],
        "additionalProperties": false,
        "allOf": [
          {
            "if": {
              "properties": {
                "resource": {
                  "const": "requests"
                }
              }
            },
            "then": {
              "required": [
                "session_id",
                "scope"
              ]
            },
            "else": {
              "not": {
                "required": [
                  "session_id"
                ]
              }
            }
          }
        ]
      },
      "state_listResult": {
        "$ref": "#/components/schemas/StateListResult"
      },
      "state_getParams": {
        "type": "object",
        "properties": {
          "resource": {
            "enum": [
              "sessions",
              "tasks",
              "goals",
              "requests"
            ]
          },
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "scope": {
            "$ref": "#/components/schemas/Scope"
          },
          "wake": {
            "type": "boolean",
            "description": "false: never wake a sleeping workspace for this read; the relay refuses it with asleep and outcome not_delivered instead. Default true."
          }
        },
        "required": [
          "resource",
          "id",
          "scope"
        ],
        "additionalProperties": false
      },
      "state_getResult": {
        "$ref": "#/components/schemas/StateGetResult"
      },
      "chat_historyParams": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "cursor": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Opaque, stable boundary from next_cursor: records older than the last page's oldest record. It stays valid as new messages arrive."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "scope": {
            "$ref": "#/components/schemas/Scope"
          },
          "after_sequence": {
            "type": "integer",
            "minimum": 0,
            "description": "Read forward: records with a greater sequence, oldest first. Excludes cursor."
          },
          "wake": {
            "type": "boolean",
            "description": "false: never wake a sleeping workspace for this read; the relay refuses it with asleep and outcome not_delivered instead. Default true."
          }
        },
        "required": [
          "session_id",
          "scope"
        ],
        "additionalProperties": false,
        "not": {
          "required": [
            "cursor",
            "after_sequence"
          ]
        }
      },
      "chat_historyResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessageRecord"
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "chat_eventsParams": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "request_id": {
            "type": "string",
            "format": "uuid"
          },
          "after": {
            "$ref": "#/components/schemas/Cursor",
            "description": "Return events after this cursor; {attempt:0, seq:0} reads from the start."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000,
            "description": "Most events to return. Default 200."
          },
          "scope": {
            "$ref": "#/components/schemas/Scope"
          },
          "wake": {
            "type": "boolean",
            "description": "false: never wake a sleeping workspace for this read; the relay refuses it with asleep and outcome not_delivered instead. Default true."
          }
        },
        "required": [
          "session_id",
          "request_id",
          "after",
          "scope"
        ],
        "additionalProperties": false
      },
      "chat_eventsResult": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "request_id": {
            "type": "string",
            "format": "uuid"
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChatEvent"
            }
          },
          "next": {
            "$ref": "#/components/schemas/Cursor",
            "description": "The last returned event's cursor, or after when none were returned. Pass it as the next after."
          },
          "done": {
            "type": "boolean",
            "description": "True when the request is terminal and no event follows next."
          }
        },
        "required": [
          "session_id",
          "request_id",
          "events",
          "next",
          "done"
        ],
        "additionalProperties": false
      },
      "task_cancelParams": {
        "type": "object",
        "properties": {
          "task_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "scope": {
            "$ref": "#/components/schemas/Scope"
          }
        },
        "required": [
          "task_id",
          "scope"
        ],
        "additionalProperties": false
      },
      "task_cancelResult": {
        "type": "object",
        "properties": {
          "requested": {
            "type": "boolean"
          }
        },
        "required": [
          "requested"
        ],
        "additionalProperties": false
      },
      "chat_cancelParams": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "request_id": {
            "type": "string",
            "format": "uuid"
          },
          "scope": {
            "$ref": "#/components/schemas/Scope"
          }
        },
        "required": [
          "session_id",
          "request_id",
          "scope"
        ],
        "additionalProperties": false
      },
      "chat_cancelResult": {
        "type": "object",
        "properties": {
          "requested": {
            "type": "boolean"
          }
        },
        "required": [
          "requested"
        ],
        "additionalProperties": false
      },
      "input_respondParams": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "request_id": {
            "type": "string",
            "format": "uuid"
          },
          "response": {
            "$ref": "#/components/schemas/InputResponse"
          },
          "scope": {
            "$ref": "#/components/schemas/Scope"
          }
        },
        "required": [
          "session_id",
          "request_id",
          "response",
          "scope"
        ],
        "additionalProperties": false
      },
      "input_respondResult": {
        "type": "object",
        "properties": {
          "applied": {
            "type": "boolean"
          }
        },
        "required": [
          "applied"
        ],
        "additionalProperties": false
      },
      "browser_snapshotParams": {
        "type": "object",
        "properties": {
          "scope": {
            "$ref": "#/components/schemas/Scope"
          }
        },
        "required": [],
        "additionalProperties": false
      },
      "browser_snapshotResult": {
        "$ref": "#/components/schemas/BrowserSnapshot"
      },
      "browser_actParams": {
        "$ref": "#/components/schemas/BrowserAction"
      },
      "browser_actResult": {
        "type": "object",
        "properties": {
          "performed": {
            "type": "boolean"
          },
          "snapshot": {
            "$ref": "#/components/schemas/BrowserSnapshot"
          }
        },
        "required": [
          "performed",
          "snapshot"
        ],
        "additionalProperties": false
      },
      "state_changedParams": {
        "$ref": "#/components/schemas/StateChanged"
      },
      "chat_messageParams": {
        "$ref": "#/components/schemas/MessageRecord"
      },
      "chat_chunkParams": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "request_id": {
            "type": "string",
            "format": "uuid"
          },
          "completion_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "seq": {
            "type": "integer",
            "minimum": 1
          },
          "chunk": {
            "$ref": "#/components/schemas/ChatCompletionChunk"
          },
          "cursor": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Cursor"
              },
              {
                "properties": {
                  "seq": {
                    "minimum": 1
                  }
                }
              }
            ],
            "description": "The cursor of the text.delta event this chunk mirrors. Requires request_id."
          },
          "scope": {
            "$ref": "#/components/schemas/Scope"
          }
        },
        "required": [
          "session_id",
          "completion_id",
          "seq",
          "chunk"
        ],
        "additionalProperties": false,
        "allOf": [
          {
            "if": {
              "required": [
                "cursor"
              ]
            },
            "then": {
              "required": [
                "request_id"
              ]
            }
          }
        ]
      },
      "chat_eventParams": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "request_id": {
            "type": "string",
            "format": "uuid"
          },
          "event": {
            "$ref": "#/components/schemas/ChatEvent"
          },
          "scope": {
            "$ref": "#/components/schemas/Scope"
          }
        },
        "required": [
          "session_id",
          "request_id",
          "event"
        ],
        "additionalProperties": false
      },
      "chat_finishedParams": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "session_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "request_id": {
                "type": "string",
                "format": "uuid"
              },
              "status": {
                "enum": [
                  "completed",
                  "cancelled"
                ]
              },
              "cursor": {
                "$ref": "#/components/schemas/Cursor",
                "description": "The request's finished event."
              },
              "revision": {
                "type": "integer",
                "minimum": 0,
                "description": "The request record's revision after it finished."
              },
              "scope": {
                "$ref": "#/components/schemas/Scope"
              }
            },
            "required": [
              "session_id",
              "request_id",
              "status"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "session_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "request_id": {
                "type": "string",
                "format": "uuid"
              },
              "status": {
                "enum": [
                  "failed",
                  "interrupted"
                ]
              },
              "error": {
                "$ref": "#/components/schemas/RequestError"
              },
              "cursor": {
                "$ref": "#/components/schemas/Cursor",
                "description": "The request's finished event."
              },
              "revision": {
                "type": "integer",
                "minimum": 0,
                "description": "The request record's revision after it finished."
              },
              "scope": {
                "$ref": "#/components/schemas/Scope"
              }
            },
            "required": [
              "session_id",
              "request_id",
              "status",
              "error"
            ],
            "additionalProperties": false
          }
        ]
      },
      "browser_changedParams": {
        "$ref": "#/components/schemas/BrowserSnapshot"
      },
      "Request": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/session_openMessage"
          },
          {
            "$ref": "#/components/schemas/chat_sendMessage"
          },
          {
            "$ref": "#/components/schemas/state_listMessage"
          },
          {
            "$ref": "#/components/schemas/state_getMessage"
          },
          {
            "$ref": "#/components/schemas/chat_historyMessage"
          },
          {
            "$ref": "#/components/schemas/chat_eventsMessage"
          },
          {
            "$ref": "#/components/schemas/task_cancelMessage"
          },
          {
            "$ref": "#/components/schemas/chat_cancelMessage"
          },
          {
            "$ref": "#/components/schemas/input_respondMessage"
          },
          {
            "$ref": "#/components/schemas/browser_snapshotMessage"
          },
          {
            "$ref": "#/components/schemas/browser_actMessage"
          },
          {
            "$ref": "#/components/schemas/session_pageMessage"
          },
          {
            "$ref": "#/components/schemas/surface_eventMessage"
          },
          {
            "$ref": "#/components/schemas/surface_actMessage"
          },
          {
            "$ref": "#/components/schemas/clarification_requestMessage"
          },
          {
            "$ref": "#/components/schemas/clarification_responseMessage"
          },
          {
            "$ref": "#/components/schemas/policy_createMessage"
          },
          {
            "$ref": "#/components/schemas/policy_updateMessage"
          },
          {
            "$ref": "#/components/schemas/policy_listMessage"
          }
        ]
      },
      "Notification": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/state_changedMessage"
          },
          {
            "$ref": "#/components/schemas/chat_messageMessage"
          },
          {
            "$ref": "#/components/schemas/chat_chunkMessage"
          },
          {
            "$ref": "#/components/schemas/chat_eventMessage"
          },
          {
            "$ref": "#/components/schemas/chat_finishedMessage"
          },
          {
            "$ref": "#/components/schemas/browser_changedMessage"
          }
        ]
      },
      "Error": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "enum": [
              "2.0"
            ]
          },
          "id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "error": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "code": {
                    "enum": [
                      -32700,
                      -32600,
                      -32601,
                      -32602,
                      -32603
                    ]
                  },
                  "message": {
                    "type": "string"
                  }
                },
                "required": [
                  "code",
                  "message"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "code": {
                    "enum": [
                      -32000
                    ]
                  },
                  "message": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "code": {
                        "enum": [
                          "unsupported",
                          "forbidden",
                          "not_found",
                          "conflict",
                          "stale_snapshot",
                          "snapshot_expired",
                          "history_unavailable",
                          "expired",
                          "unavailable",
                          "too_large",
                          "id_reused",
                          "starting",
                          "paused",
                          "gone",
                          "asleep",
                          "inference_unavailable"
                        ]
                      },
                      "outcome": {
                        "enum": [
                          "not_delivered",
                          "unknown"
                        ]
                      },
                      "retry_after_ms": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "reason": {
                        "anyOf": [
                          {
                            "$ref": "#/components/schemas/ErrorClass"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "description": "inference_unavailable only. Null while model access is being renewed."
                      },
                      "until": {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "date-time"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "description": "inference_unavailable only. When model work may start again; null when unknown."
                      }
                    },
                    "required": [
                      "code"
                    ],
                    "additionalProperties": false,
                    "allOf": [
                      {
                        "if": {
                          "properties": {
                            "code": {
                              "const": "starting"
                            }
                          }
                        },
                        "then": {
                          "required": [
                            "retry_after_ms"
                          ]
                        }
                      },
                      {
                        "if": {
                          "properties": {
                            "code": {
                              "const": "inference_unavailable"
                            }
                          }
                        },
                        "then": {
                          "required": [
                            "reason",
                            "until"
                          ]
                        },
                        "else": {
                          "properties": {
                            "reason": false,
                            "until": false
                          }
                        }
                      }
                    ]
                  }
                },
                "required": [
                  "code",
                  "message",
                  "data"
                ],
                "additionalProperties": false
              }
            ]
          }
        },
        "required": [
          "jsonrpc",
          "id",
          "error"
        ],
        "additionalProperties": false
      },
      "session_openMessage": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "method": {
            "const": "session.open"
          },
          "params": {
            "$ref": "#/components/schemas/session_openParams"
          }
        },
        "required": [
          "jsonrpc",
          "id",
          "method",
          "params"
        ],
        "additionalProperties": false
      },
      "session_openReply": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "jsonrpc": {
                "const": "2.0"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "result": {
                "$ref": "#/components/schemas/session_openResult"
              }
            },
            "required": [
              "jsonrpc",
              "id",
              "result"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/components/schemas/Error"
          }
        ]
      },
      "chat_sendMessage": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "method": {
            "const": "chat.send"
          },
          "params": {
            "$ref": "#/components/schemas/chat_sendParams"
          }
        },
        "required": [
          "jsonrpc",
          "id",
          "method",
          "params"
        ],
        "additionalProperties": false
      },
      "chat_sendReply": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "jsonrpc": {
                "const": "2.0"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "result": {
                "$ref": "#/components/schemas/chat_sendResult"
              }
            },
            "required": [
              "jsonrpc",
              "id",
              "result"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/components/schemas/Error"
          }
        ]
      },
      "state_listMessage": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "method": {
            "const": "state.list"
          },
          "params": {
            "$ref": "#/components/schemas/state_listParams"
          }
        },
        "required": [
          "jsonrpc",
          "id",
          "method",
          "params"
        ],
        "additionalProperties": false
      },
      "state_listReply": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "jsonrpc": {
                "const": "2.0"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "result": {
                "$ref": "#/components/schemas/state_listResult"
              }
            },
            "required": [
              "jsonrpc",
              "id",
              "result"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/components/schemas/Error"
          }
        ]
      },
      "state_getMessage": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "method": {
            "const": "state.get"
          },
          "params": {
            "$ref": "#/components/schemas/state_getParams"
          }
        },
        "required": [
          "jsonrpc",
          "id",
          "method",
          "params"
        ],
        "additionalProperties": false
      },
      "state_getReply": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "jsonrpc": {
                "const": "2.0"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "result": {
                "$ref": "#/components/schemas/state_getResult"
              }
            },
            "required": [
              "jsonrpc",
              "id",
              "result"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/components/schemas/Error"
          }
        ]
      },
      "chat_historyMessage": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "method": {
            "const": "chat.history"
          },
          "params": {
            "$ref": "#/components/schemas/chat_historyParams"
          }
        },
        "required": [
          "jsonrpc",
          "id",
          "method",
          "params"
        ],
        "additionalProperties": false
      },
      "chat_historyReply": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "jsonrpc": {
                "const": "2.0"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "result": {
                "$ref": "#/components/schemas/chat_historyResult"
              }
            },
            "required": [
              "jsonrpc",
              "id",
              "result"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/components/schemas/Error"
          }
        ]
      },
      "chat_eventsMessage": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "method": {
            "const": "chat.events"
          },
          "params": {
            "$ref": "#/components/schemas/chat_eventsParams"
          }
        },
        "required": [
          "jsonrpc",
          "id",
          "method",
          "params"
        ],
        "additionalProperties": false
      },
      "chat_eventsReply": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "jsonrpc": {
                "const": "2.0"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "result": {
                "$ref": "#/components/schemas/chat_eventsResult"
              }
            },
            "required": [
              "jsonrpc",
              "id",
              "result"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/components/schemas/Error"
          }
        ]
      },
      "task_cancelMessage": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "method": {
            "const": "task.cancel"
          },
          "params": {
            "$ref": "#/components/schemas/task_cancelParams"
          }
        },
        "required": [
          "jsonrpc",
          "id",
          "method",
          "params"
        ],
        "additionalProperties": false
      },
      "task_cancelReply": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "jsonrpc": {
                "const": "2.0"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "result": {
                "$ref": "#/components/schemas/task_cancelResult"
              }
            },
            "required": [
              "jsonrpc",
              "id",
              "result"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/components/schemas/Error"
          }
        ]
      },
      "chat_cancelMessage": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "method": {
            "const": "chat.cancel"
          },
          "params": {
            "$ref": "#/components/schemas/chat_cancelParams"
          }
        },
        "required": [
          "jsonrpc",
          "id",
          "method",
          "params"
        ],
        "additionalProperties": false
      },
      "chat_cancelReply": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "jsonrpc": {
                "const": "2.0"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "result": {
                "$ref": "#/components/schemas/chat_cancelResult"
              }
            },
            "required": [
              "jsonrpc",
              "id",
              "result"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/components/schemas/Error"
          }
        ]
      },
      "input_respondMessage": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "method": {
            "const": "input.respond"
          },
          "params": {
            "$ref": "#/components/schemas/input_respondParams"
          }
        },
        "required": [
          "jsonrpc",
          "id",
          "method",
          "params"
        ],
        "additionalProperties": false
      },
      "input_respondReply": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "jsonrpc": {
                "const": "2.0"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "result": {
                "$ref": "#/components/schemas/input_respondResult"
              }
            },
            "required": [
              "jsonrpc",
              "id",
              "result"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/components/schemas/Error"
          }
        ]
      },
      "browser_snapshotMessage": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "method": {
            "const": "browser.snapshot"
          },
          "params": {
            "$ref": "#/components/schemas/browser_snapshotParams"
          }
        },
        "required": [
          "jsonrpc",
          "id",
          "method",
          "params"
        ],
        "additionalProperties": false
      },
      "browser_snapshotReply": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "jsonrpc": {
                "const": "2.0"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "result": {
                "$ref": "#/components/schemas/browser_snapshotResult"
              }
            },
            "required": [
              "jsonrpc",
              "id",
              "result"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/components/schemas/Error"
          }
        ]
      },
      "browser_actMessage": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "method": {
            "const": "browser.act"
          },
          "params": {
            "$ref": "#/components/schemas/browser_actParams"
          }
        },
        "required": [
          "jsonrpc",
          "id",
          "method",
          "params"
        ],
        "additionalProperties": false
      },
      "browser_actReply": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "jsonrpc": {
                "const": "2.0"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "result": {
                "$ref": "#/components/schemas/browser_actResult"
              }
            },
            "required": [
              "jsonrpc",
              "id",
              "result"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/components/schemas/Error"
          }
        ]
      },
      "state_changedMessage": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "method": {
            "const": "state.changed"
          },
          "params": {
            "$ref": "#/components/schemas/state_changedParams"
          }
        },
        "required": [
          "jsonrpc",
          "method",
          "params"
        ],
        "additionalProperties": false
      },
      "chat_messageMessage": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "method": {
            "const": "chat.message"
          },
          "params": {
            "$ref": "#/components/schemas/chat_messageParams"
          }
        },
        "required": [
          "jsonrpc",
          "method",
          "params"
        ],
        "additionalProperties": false
      },
      "chat_chunkMessage": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "method": {
            "const": "chat.chunk"
          },
          "params": {
            "$ref": "#/components/schemas/chat_chunkParams"
          }
        },
        "required": [
          "jsonrpc",
          "method",
          "params"
        ],
        "additionalProperties": false
      },
      "chat_eventMessage": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "method": {
            "const": "chat.event"
          },
          "params": {
            "$ref": "#/components/schemas/chat_eventParams"
          }
        },
        "required": [
          "jsonrpc",
          "method",
          "params"
        ],
        "additionalProperties": false
      },
      "chat_finishedMessage": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "method": {
            "const": "chat.finished"
          },
          "params": {
            "$ref": "#/components/schemas/chat_finishedParams"
          }
        },
        "required": [
          "jsonrpc",
          "method",
          "params"
        ],
        "additionalProperties": false
      },
      "browser_changedMessage": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "method": {
            "const": "browser.changed"
          },
          "params": {
            "$ref": "#/components/schemas/browser_changedParams"
          }
        },
        "required": [
          "jsonrpc",
          "method",
          "params"
        ],
        "additionalProperties": false
      },
      "frontendBinding": {
        "type": "object",
        "properties": {
          "binding": {
            "type": "object",
            "properties": {
              "frontend_id": {
                "type": "string",
                "format": "uuid"
              },
              "version": {
                "const": "1.0.0"
              },
              "max_message_bytes": {
                "const": 1048576
              }
            },
            "required": [
              "frontend_id",
              "version",
              "max_message_bytes"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "binding"
        ],
        "additionalProperties": false
      },
      "backendBinding": {
        "type": "object",
        "properties": {
          "binding": {
            "type": "object",
            "properties": {
              "backend_id": {
                "type": "string",
                "format": "uuid"
              },
              "version": {
                "const": "1.0.0"
              },
              "max_message_bytes": {
                "const": 1048576
              }
            },
            "required": [
              "backend_id",
              "version",
              "max_message_bytes"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "binding"
        ],
        "additionalProperties": false
      },
      "Scope": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "scope": {
                "const": "workspace"
              },
              "coworld": {
                "type": "null"
              },
              "league": {
                "type": "null"
              }
            },
            "required": [
              "scope",
              "coworld",
              "league"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "scope": {
                "const": "coworld"
              },
              "coworld": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "league": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              }
            },
            "required": [
              "scope",
              "coworld",
              "league"
            ],
            "additionalProperties": false
          }
        ]
      },
      "frontend_closedMessage": {
        "type": "object",
        "description": "Relay-owned. Sent only by the relay, only to the backend, when a frontend connection ends; the frame's frontend_id names it. Its session subscriptions end.",
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "method": {
            "const": "frontend.closed"
          },
          "params": {
            "type": "object",
            "properties": {},
            "additionalProperties": false
          }
        },
        "required": [
          "jsonrpc",
          "method",
          "params"
        ],
        "additionalProperties": false
      },
      "aide_presenceParams": {
        "type": "object",
        "properties": {
          "present": {
            "type": "boolean"
          }
        },
        "required": [
          "present"
        ],
        "additionalProperties": false
      },
      "aide_presenceMessage": {
        "type": "object",
        "description": "Relay-owned: the workspace backend connected (present:true) or went away (present:false). On either, read every open request's record and its events from the last applied cursor. Peers never send it.",
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "method": {
            "const": "aide.presence"
          },
          "params": {
            "$ref": "#/components/schemas/aide_presenceParams"
          }
        },
        "required": [
          "jsonrpc",
          "method",
          "params"
        ],
        "additionalProperties": false
      },
      "session_pageMessage": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "method": {
            "const": "session.page"
          },
          "params": {
            "$ref": "#/components/schemas/session_pageParams"
          }
        },
        "required": [
          "jsonrpc",
          "id",
          "method",
          "params"
        ],
        "additionalProperties": false
      },
      "session_pageReply": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "jsonrpc": {
                "const": "2.0"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "result": {
                "$ref": "#/components/schemas/session_pageResult"
              }
            },
            "required": [
              "jsonrpc",
              "id",
              "result"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/components/schemas/Error"
          }
        ]
      },
      "session_pageParams": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "scope": {
            "$ref": "#/components/schemas/Scope"
          },
          "page": {
            "type": "object",
            "properties": {
              "scope": {
                "const": "coworld"
              },
              "coworld": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "league": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              }
            },
            "required": [
              "scope",
              "coworld",
              "league"
            ],
            "additionalProperties": false
          },
          "related_uploads": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "maxItems": 1000,
            "description": "Other uploads of the viewed Coworld, for grouping."
          },
          "target_session_id": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ],
            "description": "The target from the offer. Include it only after confirmation. Null creates a session."
          }
        },
        "required": [
          "session_id",
          "scope",
          "page",
          "related_uploads"
        ],
        "additionalProperties": false
      },
      "session_pageResult": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "kind": {
                "const": "stay"
              }
            },
            "required": [
              "kind"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "const": "offer"
              },
              "target_session_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The target from the offer. Include it only after confirmation. Null creates a session."
              }
            },
            "required": [
              "kind",
              "target_session_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "const": "switched"
              },
              "session": {
                "$ref": "#/components/schemas/Session"
              }
            },
            "required": [
              "kind",
              "session"
            ],
            "additionalProperties": false
          }
        ]
      },
      "surface_eventParams": {
        "type": "object",
        "properties": {
          "scope": {
            "$ref": "#/components/schemas/Scope"
          },
          "data": {
            "type": "object",
            "description": "Observation of a change in the frontend's state, passed to AIDE unchanged. The platform does not interpret it."
          }
        },
        "required": [
          "scope",
          "data"
        ],
        "additionalProperties": false
      },
      "surface_eventResult": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "description": "AIDE-defined answer to the observation, passed to the frontend unchanged. Empty when there is none."
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "surface_eventMessage": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "method": {
            "const": "surface.event"
          },
          "params": {
            "$ref": "#/components/schemas/surface_eventParams"
          }
        },
        "required": [
          "jsonrpc",
          "id",
          "method",
          "params"
        ],
        "additionalProperties": false
      },
      "surface_eventReply": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "jsonrpc": {
                "const": "2.0"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "result": {
                "$ref": "#/components/schemas/surface_eventResult"
              }
            },
            "required": [
              "jsonrpc",
              "id",
              "result"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/components/schemas/Error"
          }
        ]
      },
      "surface_actParams": {
        "type": "object",
        "properties": {
          "scope": {
            "$ref": "#/components/schemas/Scope"
          },
          "data": {
            "type": "object",
            "description": "Action for the frontend to apply to itself, passed to the frontend unchanged. The platform does not interpret it."
          }
        },
        "required": [
          "scope",
          "data"
        ],
        "additionalProperties": false
      },
      "surface_actResult": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "description": "Frontend-defined outcome of the action, passed to AIDE unchanged. Empty when there is none."
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "surface_actMessage": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "method": {
            "const": "surface.act"
          },
          "params": {
            "$ref": "#/components/schemas/surface_actParams"
          }
        },
        "required": [
          "jsonrpc",
          "id",
          "method",
          "params"
        ],
        "additionalProperties": false
      },
      "surface_actReply": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "jsonrpc": {
                "const": "2.0"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "result": {
                "$ref": "#/components/schemas/surface_actResult"
              }
            },
            "required": [
              "jsonrpc",
              "id",
              "result"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/components/schemas/Error"
          }
        ]
      },
      "Source": {
        "enum": [
          "user",
          "surface"
        ],
        "description": "Who writes a session's messages to the agent: the person using the frontend (user) or the frontend itself (surface)."
      },
      "clarification_requestParams": {
        "type": "object",
        "properties": {
          "prompt": {
            "type": "string",
            "minLength": 1,
            "description": "The question to answer."
          },
          "session_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "The session the question belongs to, when there is one."
          },
          "scope": {
            "$ref": "#/components/schemas/Scope"
          }
        },
        "required": [
          "prompt",
          "scope"
        ],
        "additionalProperties": false
      },
      "clarification_requestResult": {
        "type": "object",
        "properties": {
          "accepted": {
            "const": true
          }
        },
        "required": [
          "accepted"
        ],
        "additionalProperties": false
      },
      "clarification_requestMessage": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "method": {
            "const": "clarification.request"
          },
          "params": {
            "$ref": "#/components/schemas/clarification_requestParams"
          }
        },
        "required": [
          "jsonrpc",
          "id",
          "method",
          "params"
        ],
        "additionalProperties": false
      },
      "clarification_requestReply": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "jsonrpc": {
                "const": "2.0"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "result": {
                "$ref": "#/components/schemas/clarification_requestResult"
              }
            },
            "required": [
              "jsonrpc",
              "id",
              "result"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/components/schemas/Error"
          }
        ]
      },
      "clarification_responseParams": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "format": "uuid",
            "description": "The outer id of the clarification.request being answered."
          },
          "answer": {
            "type": "string",
            "minLength": 1
          },
          "scope": {
            "$ref": "#/components/schemas/Scope"
          }
        },
        "required": [
          "request_id",
          "answer",
          "scope"
        ],
        "additionalProperties": false
      },
      "clarification_responseResult": {
        "type": "object",
        "properties": {
          "applied": {
            "const": true
          }
        },
        "required": [
          "applied"
        ],
        "additionalProperties": false
      },
      "clarification_responseMessage": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "method": {
            "const": "clarification.response"
          },
          "params": {
            "$ref": "#/components/schemas/clarification_responseParams"
          }
        },
        "required": [
          "jsonrpc",
          "id",
          "method",
          "params"
        ],
        "additionalProperties": false
      },
      "clarification_responseReply": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "jsonrpc": {
                "const": "2.0"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "result": {
                "$ref": "#/components/schemas/clarification_responseResult"
              }
            },
            "required": [
              "jsonrpc",
              "id",
              "result"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/components/schemas/Error"
          }
        ]
      },
      "PolicyBlob": {
        "type": "object",
        "description": "The policy's content. Only inline text is defined; kind leaves room for other carriers.",
        "properties": {
          "kind": {
            "enum": [
              "text"
            ]
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000000,
            "description": "The complete policy source, one file."
          }
        },
        "required": [
          "kind",
          "text"
        ],
        "additionalProperties": false
      },
      "Policy": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[^:]+$",
            "description": "The frontend's key for the policy."
          },
          "blob": {
            "$ref": "#/components/schemas/PolicyBlob"
          },
          "scope": {
            "$ref": "#/components/schemas/Scope"
          }
        },
        "required": [
          "name",
          "blob",
          "scope"
        ],
        "additionalProperties": false
      },
      "PolicyVersion": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[^:]+$",
            "description": "The frontend's key for the policy."
          },
          "version": {
            "type": "integer",
            "minimum": 1,
            "description": "The version the frontend deployed."
          }
        },
        "required": [
          "name",
          "version"
        ],
        "additionalProperties": false
      },
      "policy_createParams": {
        "$ref": "#/components/schemas/Policy"
      },
      "policy_createResult": {
        "$ref": "#/components/schemas/PolicyVersion"
      },
      "policy_createMessage": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "method": {
            "const": "policy.create"
          },
          "params": {
            "$ref": "#/components/schemas/policy_createParams"
          }
        },
        "required": [
          "jsonrpc",
          "id",
          "method",
          "params"
        ],
        "additionalProperties": false
      },
      "policy_createReply": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "jsonrpc": {
                "const": "2.0"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "result": {
                "$ref": "#/components/schemas/policy_createResult"
              }
            },
            "required": [
              "jsonrpc",
              "id",
              "result"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/components/schemas/Error"
          }
        ]
      },
      "policy_updateParams": {
        "$ref": "#/components/schemas/Policy"
      },
      "policy_updateResult": {
        "$ref": "#/components/schemas/PolicyVersion"
      },
      "policy_updateMessage": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "method": {
            "const": "policy.update"
          },
          "params": {
            "$ref": "#/components/schemas/policy_updateParams"
          }
        },
        "required": [
          "jsonrpc",
          "id",
          "method",
          "params"
        ],
        "additionalProperties": false
      },
      "policy_updateReply": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "jsonrpc": {
                "const": "2.0"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "result": {
                "$ref": "#/components/schemas/policy_updateResult"
              }
            },
            "required": [
              "jsonrpc",
              "id",
              "result"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/components/schemas/Error"
          }
        ]
      },
      "policy_listParams": {
        "type": "object",
        "properties": {
          "scope": {
            "$ref": "#/components/schemas/Scope"
          }
        },
        "required": [
          "scope"
        ],
        "additionalProperties": false
      },
      "policy_listResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PolicyVersion"
            },
            "description": "Every policy the frontend holds in the scope, in no set order."
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": false
      },
      "policy_listMessage": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "method": {
            "const": "policy.list"
          },
          "params": {
            "$ref": "#/components/schemas/policy_listParams"
          }
        },
        "required": [
          "jsonrpc",
          "id",
          "method",
          "params"
        ],
        "additionalProperties": false
      },
      "policy_listReply": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "jsonrpc": {
                "const": "2.0"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "result": {
                "$ref": "#/components/schemas/policy_listResult"
              }
            },
            "required": [
              "jsonrpc",
              "id",
              "result"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/components/schemas/Error"
          }
        ]
      }
    },
    "messages": {
      "frontend_error": {
        "name": "frontend_error",
        "title": "error",
        "contentType": "application/json",
        "description": "JSON-RPC error. Match id to the pending request; malformed input may use null. Unsupported is a normal correlated refusal.",
        "payload": {
          "$ref": "#/components/schemas/Error"
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "backend_error": {
        "name": "backend_error",
        "title": "error",
        "contentType": "application/json",
        "description": "JSON-RPC error. Match id to the pending request; malformed input may use null. Unsupported is a normal correlated refusal.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "$ref": "#/components/schemas/Error"
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "frontend_session_open": {
        "name": "frontend_session_open",
        "title": "session_open",
        "contentType": "application/json",
        "description": "Ask AIDE to create a conversation. The returned session is authoritative.",
        "payload": {
          "$ref": "#/components/schemas/session_openMessage"
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "frontend_session_open_result": {
        "name": "frontend_session_open_result",
        "title": "session_open_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "jsonrpc": {
              "const": "2.0"
            },
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "result": {
              "$ref": "#/components/schemas/session_openResult"
            }
          },
          "required": [
            "jsonrpc",
            "id",
            "result"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "backend_session_open": {
        "name": "backend_session_open",
        "title": "session_open",
        "contentType": "application/json",
        "description": "Ask AIDE to create a conversation. The returned session is authoritative.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "$ref": "#/components/schemas/session_openMessage"
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "backend_session_open_result": {
        "name": "backend_session_open_result",
        "title": "session_open_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "type": "object",
              "properties": {
                "jsonrpc": {
                  "const": "2.0"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "result": {
                  "$ref": "#/components/schemas/session_openResult"
                }
              },
              "required": [
                "jsonrpc",
                "id",
                "result"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "frontend_chat_send": {
        "name": "frontend_chat_send",
        "title": "chat_send",
        "contentType": "application/json",
        "description": "Append ordered OpenAI messages atomically. Acceptance records recoverable responsibility; it does not mean completion. request_id equals the request id.",
        "payload": {
          "$ref": "#/components/schemas/chat_sendMessage"
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "frontend_chat_send_result": {
        "name": "frontend_chat_send_result",
        "title": "chat_send_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "jsonrpc": {
              "const": "2.0"
            },
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "result": {
              "$ref": "#/components/schemas/chat_sendResult"
            }
          },
          "required": [
            "jsonrpc",
            "id",
            "result"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "backend_chat_send": {
        "name": "backend_chat_send",
        "title": "chat_send",
        "contentType": "application/json",
        "description": "Append ordered OpenAI messages atomically. Acceptance records recoverable responsibility; it does not mean completion. request_id equals the request id.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "$ref": "#/components/schemas/chat_sendMessage"
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "backend_chat_send_result": {
        "name": "backend_chat_send_result",
        "title": "chat_send_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "type": "object",
              "properties": {
                "jsonrpc": {
                  "const": "2.0"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "result": {
                  "$ref": "#/components/schemas/chat_sendResult"
                }
              },
              "required": [
                "jsonrpc",
                "id",
                "result"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "frontend_state_list": {
        "name": "frontend_state_list",
        "title": "state_list",
        "contentType": "application/json",
        "description": "Read a complete, paginated inventory of sessions, tasks, goals, or one session's requests. Unsupported resources return unsupported, never a misleading empty list.",
        "payload": {
          "$ref": "#/components/schemas/state_listMessage"
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "frontend_state_list_result": {
        "name": "frontend_state_list_result",
        "title": "state_list_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "jsonrpc": {
              "const": "2.0"
            },
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "result": {
              "$ref": "#/components/schemas/state_listResult"
            }
          },
          "required": [
            "jsonrpc",
            "id",
            "result"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "backend_state_list": {
        "name": "backend_state_list",
        "title": "state_list",
        "contentType": "application/json",
        "description": "Read a complete, paginated inventory of sessions, tasks, goals, or one session's requests. Unsupported resources return unsupported, never a misleading empty list.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "$ref": "#/components/schemas/state_listMessage"
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "backend_state_list_result": {
        "name": "backend_state_list_result",
        "title": "state_list_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "type": "object",
              "properties": {
                "jsonrpc": {
                  "const": "2.0"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "result": {
                  "$ref": "#/components/schemas/state_listResult"
                }
              },
              "required": [
                "jsonrpc",
                "id",
                "result"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "frontend_state_get": {
        "name": "frontend_state_get",
        "title": "state_get",
        "contentType": "application/json",
        "description": "Read one public state object. The result resource and object id must match the request.",
        "payload": {
          "$ref": "#/components/schemas/state_getMessage"
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "frontend_state_get_result": {
        "name": "frontend_state_get_result",
        "title": "state_get_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "jsonrpc": {
              "const": "2.0"
            },
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "result": {
              "$ref": "#/components/schemas/state_getResult"
            }
          },
          "required": [
            "jsonrpc",
            "id",
            "result"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "backend_state_get": {
        "name": "backend_state_get",
        "title": "state_get",
        "contentType": "application/json",
        "description": "Read one public state object. The result resource and object id must match the request.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "$ref": "#/components/schemas/state_getMessage"
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "backend_state_get_result": {
        "name": "backend_state_get_result",
        "title": "state_get_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "type": "object",
              "properties": {
                "jsonrpc": {
                  "const": "2.0"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "result": {
                  "$ref": "#/components/schemas/state_getResult"
                }
              },
              "required": [
                "jsonrpc",
                "id",
                "result"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "frontend_chat_history": {
        "name": "frontend_chat_history",
        "title": "chat_history",
        "contentType": "application/json",
        "description": "Read retained complete OpenAI messages, including assistant tool calls and tool results. Cursors are opaque.",
        "payload": {
          "$ref": "#/components/schemas/chat_historyMessage"
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "frontend_chat_history_result": {
        "name": "frontend_chat_history_result",
        "title": "chat_history_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "jsonrpc": {
              "const": "2.0"
            },
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "result": {
              "$ref": "#/components/schemas/chat_historyResult"
            }
          },
          "required": [
            "jsonrpc",
            "id",
            "result"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "frontend_chat_events": {
        "name": "frontend_chat_events",
        "title": "chat_events",
        "contentType": "application/json",
        "description": "Read one chat request's progress events after a cursor, in cursor order. Pages fit the message limit; continue from next until done.",
        "payload": {
          "$ref": "#/components/schemas/chat_eventsMessage"
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "frontend_chat_events_result": {
        "name": "frontend_chat_events_result",
        "title": "chat_events_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "jsonrpc": {
              "const": "2.0"
            },
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "result": {
              "$ref": "#/components/schemas/chat_eventsResult"
            }
          },
          "required": [
            "jsonrpc",
            "id",
            "result"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "backend_chat_history": {
        "name": "backend_chat_history",
        "title": "chat_history",
        "contentType": "application/json",
        "description": "Read retained complete OpenAI messages, including assistant tool calls and tool results. Cursors are opaque.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "$ref": "#/components/schemas/chat_historyMessage"
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "backend_chat_history_result": {
        "name": "backend_chat_history_result",
        "title": "chat_history_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "type": "object",
              "properties": {
                "jsonrpc": {
                  "const": "2.0"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "result": {
                  "$ref": "#/components/schemas/chat_historyResult"
                }
              },
              "required": [
                "jsonrpc",
                "id",
                "result"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "backend_chat_events": {
        "name": "backend_chat_events",
        "title": "chat_events",
        "contentType": "application/json",
        "description": "Read one chat request's progress events after a cursor, in cursor order. Pages fit the message limit; continue from next until done.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "$ref": "#/components/schemas/chat_eventsMessage"
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "backend_chat_events_result": {
        "name": "backend_chat_events_result",
        "title": "chat_events_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "type": "object",
              "properties": {
                "jsonrpc": {
                  "const": "2.0"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "result": {
                  "$ref": "#/components/schemas/chat_eventsResult"
                }
              },
              "required": [
                "jsonrpc",
                "id",
                "result"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "frontend_task_cancel": {
        "name": "frontend_task_cancel",
        "title": "task_cancel",
        "contentType": "application/json",
        "description": "Ask AIDE to cancel a task. requested=true confirms registration, not completion. Observe subsequent task state.",
        "payload": {
          "$ref": "#/components/schemas/task_cancelMessage"
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "frontend_task_cancel_result": {
        "name": "frontend_task_cancel_result",
        "title": "task_cancel_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "jsonrpc": {
              "const": "2.0"
            },
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "result": {
              "$ref": "#/components/schemas/task_cancelResult"
            }
          },
          "required": [
            "jsonrpc",
            "id",
            "result"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "backend_task_cancel": {
        "name": "backend_task_cancel",
        "title": "task_cancel",
        "contentType": "application/json",
        "description": "Ask AIDE to cancel a task. requested=true confirms registration, not completion. Observe subsequent task state.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "$ref": "#/components/schemas/task_cancelMessage"
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "backend_task_cancel_result": {
        "name": "backend_task_cancel_result",
        "title": "task_cancel_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "type": "object",
              "properties": {
                "jsonrpc": {
                  "const": "2.0"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "result": {
                  "$ref": "#/components/schemas/task_cancelResult"
                }
              },
              "required": [
                "jsonrpc",
                "id",
                "result"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "frontend_chat_cancel": {
        "name": "frontend_chat_cancel",
        "title": "chat_cancel",
        "contentType": "application/json",
        "description": "Ask AIDE to cancel the chat.send identified by request_id in this session. The outer id identifies this cancellation request.",
        "payload": {
          "$ref": "#/components/schemas/chat_cancelMessage"
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "backend_chat_cancel": {
        "name": "backend_chat_cancel",
        "title": "chat_cancel",
        "contentType": "application/json",
        "description": "Ask AIDE to cancel the chat.send identified by request_id in this session. The outer id identifies this cancellation request.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "$ref": "#/components/schemas/chat_cancelMessage"
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "frontend_input_respond": {
        "name": "frontend_input_respond",
        "title": "input_respond",
        "contentType": "application/json",
        "description": "Answer a pending session approval (once or deny). request_id identifies the pending input. A stale answer returns conflict. Answering a pending clarification is deprecated; see clarification.response.",
        "payload": {
          "$ref": "#/components/schemas/input_respondMessage"
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "frontend_input_respond_result": {
        "name": "frontend_input_respond_result",
        "title": "input_respond_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "jsonrpc": {
              "const": "2.0"
            },
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "result": {
              "$ref": "#/components/schemas/input_respondResult"
            }
          },
          "required": [
            "jsonrpc",
            "id",
            "result"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "backend_input_respond": {
        "name": "backend_input_respond",
        "title": "input_respond",
        "contentType": "application/json",
        "description": "Answer a pending session approval (once or deny). request_id identifies the pending input. A stale answer returns conflict. Answering a pending clarification is deprecated; see clarification.response.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "$ref": "#/components/schemas/input_respondMessage"
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "backend_input_respond_result": {
        "name": "backend_input_respond_result",
        "title": "input_respond_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "type": "object",
              "properties": {
                "jsonrpc": {
                  "const": "2.0"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "result": {
                  "$ref": "#/components/schemas/input_respondResult"
                }
              },
              "required": [
                "jsonrpc",
                "id",
                "result"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "frontend_browser_snapshot": {
        "name": "frontend_browser_snapshot",
        "title": "browser_snapshot",
        "contentType": "application/json",
        "description": "Ask the frontend for its exposed DOM tree. An empty parameter object is required; the result is a complete typed snapshot.",
        "payload": {
          "$ref": "#/components/schemas/browser_snapshotMessage"
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "frontend_browser_snapshot_result": {
        "name": "frontend_browser_snapshot_result",
        "title": "browser_snapshot_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "jsonrpc": {
              "const": "2.0"
            },
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "result": {
              "$ref": "#/components/schemas/browser_snapshotResult"
            }
          },
          "required": [
            "jsonrpc",
            "id",
            "result"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "backend_browser_snapshot": {
        "name": "backend_browser_snapshot",
        "title": "browser_snapshot",
        "contentType": "application/json",
        "description": "Ask the frontend for its exposed DOM tree. An empty parameter object is required; the result is a complete typed snapshot.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "$ref": "#/components/schemas/browser_snapshotMessage"
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "backend_browser_snapshot_result": {
        "name": "backend_browser_snapshot_result",
        "title": "browser_snapshot_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "type": "object",
              "properties": {
                "jsonrpc": {
                  "const": "2.0"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "result": {
                  "$ref": "#/components/schemas/browser_snapshotResult"
                }
              },
              "required": [
                "jsonrpc",
                "id",
                "result"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "frontend_browser_act": {
        "name": "frontend_browser_act",
        "title": "browser_act",
        "contentType": "application/json",
        "description": "Ask the frontend to click, fill, or highlight one exposed node. Check document, revision, allowed action and expiry before acting. Never replay after reconnect.",
        "payload": {
          "$ref": "#/components/schemas/browser_actMessage"
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "frontend_browser_act_result": {
        "name": "frontend_browser_act_result",
        "title": "browser_act_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "jsonrpc": {
              "const": "2.0"
            },
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "result": {
              "$ref": "#/components/schemas/browser_actResult"
            }
          },
          "required": [
            "jsonrpc",
            "id",
            "result"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "backend_browser_act": {
        "name": "backend_browser_act",
        "title": "browser_act",
        "contentType": "application/json",
        "description": "Ask the frontend to click, fill, or highlight one exposed node. Check document, revision, allowed action and expiry before acting. Never replay after reconnect.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "$ref": "#/components/schemas/browser_actMessage"
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "backend_browser_act_result": {
        "name": "backend_browser_act_result",
        "title": "browser_act_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "type": "object",
              "properties": {
                "jsonrpc": {
                  "const": "2.0"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "result": {
                  "$ref": "#/components/schemas/browser_actResult"
                }
              },
              "required": [
                "jsonrpc",
                "id",
                "result"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "frontend_state_changed": {
        "name": "frontend_state_changed",
        "title": "state_changed",
        "contentType": "application/json",
        "description": "Replace one complete record, delete it, or invalidate the collection. Refetch on a revision gap or changed epoch.",
        "payload": {
          "$ref": "#/components/schemas/state_changedMessage"
        }
      },
      "backend_state_changed": {
        "name": "backend_state_changed",
        "title": "state_changed",
        "contentType": "application/json",
        "description": "Replace one complete record, delete it, or invalidate the collection. Refetch on a revision gap or changed epoch.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "$ref": "#/components/schemas/state_changedMessage"
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        }
      },
      "frontend_chat_message": {
        "name": "frontend_chat_message",
        "title": "chat_message",
        "contentType": "application/json",
        "description": "A retained complete OpenAI message. Read history to recover missed messages.",
        "payload": {
          "$ref": "#/components/schemas/chat_messageMessage"
        }
      },
      "backend_chat_message": {
        "name": "backend_chat_message",
        "title": "chat_message",
        "contentType": "application/json",
        "description": "A retained complete OpenAI message. Read history to recover missed messages.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "$ref": "#/components/schemas/chat_messageMessage"
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        }
      },
      "frontend_chat_chunk": {
        "name": "frontend_chat_chunk",
        "title": "chat_chunk",
        "contentType": "application/json",
        "description": "An OpenAI ChatCompletionChunk, including tool-call deltas: the OpenAI-shaped mirror of a text.delta event. Sequence starts at one per completion. cursor is that event's position; on a gap read chat.events.",
        "payload": {
          "$ref": "#/components/schemas/chat_chunkMessage"
        }
      },
      "frontend_chat_event": {
        "name": "frontend_chat_event",
        "title": "chat_event",
        "contentType": "application/json",
        "description": "The push form of a ChatEvent, with the same cursor chat.events returns. A cursor that does not follow the last applied one means missed events: read chat.events.",
        "payload": {
          "$ref": "#/components/schemas/chat_eventMessage"
        }
      },
      "backend_chat_chunk": {
        "name": "backend_chat_chunk",
        "title": "chat_chunk",
        "contentType": "application/json",
        "description": "An OpenAI ChatCompletionChunk, including tool-call deltas: the OpenAI-shaped mirror of a text.delta event. Sequence starts at one per completion. cursor is that event's position; on a gap read chat.events.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "$ref": "#/components/schemas/chat_chunkMessage"
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        }
      },
      "backend_chat_event": {
        "name": "backend_chat_event",
        "title": "chat_event",
        "contentType": "application/json",
        "description": "The push form of a ChatEvent, with the same cursor chat.events returns. A cursor that does not follow the last applied one means missed events: read chat.events.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "$ref": "#/components/schemas/chat_eventMessage"
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        }
      },
      "frontend_chat_finished": {
        "name": "frontend_chat_finished",
        "title": "chat_finished",
        "contentType": "application/json",
        "description": "Terminal chat outcome. A failed or interrupted outcome includes an error. The request record (resource requests) stays authoritative; a missed notification is recovered by reading it.",
        "payload": {
          "$ref": "#/components/schemas/chat_finishedMessage"
        }
      },
      "backend_chat_finished": {
        "name": "backend_chat_finished",
        "title": "chat_finished",
        "contentType": "application/json",
        "description": "Terminal chat outcome. A failed or interrupted outcome includes an error. The request record (resource requests) stays authoritative; a missed notification is recovered by reading it.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "$ref": "#/components/schemas/chat_finishedMessage"
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        }
      },
      "frontend_browser_changed": {
        "name": "frontend_browser_changed",
        "title": "browser_changed",
        "contentType": "application/json",
        "description": "A complete exposed DOM snapshot. Optional notifications may be coalesced; browser.snapshot remains the pull operation.",
        "payload": {
          "$ref": "#/components/schemas/browser_changedMessage"
        }
      },
      "backend_browser_changed": {
        "name": "backend_browser_changed",
        "title": "browser_changed",
        "contentType": "application/json",
        "description": "A complete exposed DOM snapshot. Optional notifications may be coalesced; browser.snapshot remains the pull operation.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "$ref": "#/components/schemas/browser_changedMessage"
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        }
      },
      "frontend_binding": {
        "name": "frontend_binding",
        "title": "binding",
        "contentType": "application/json",
        "description": "First server frame after a successful upgrade. Transport metadata, not JSON-RPC or capability discovery.",
        "payload": {
          "$ref": "#/components/schemas/frontendBinding"
        }
      },
      "backend_binding": {
        "name": "backend_binding",
        "title": "binding",
        "contentType": "application/json",
        "description": "First server frame after a successful upgrade. Transport metadata, not JSON-RPC or capability discovery.",
        "payload": {
          "$ref": "#/components/schemas/backendBinding"
        }
      },
      "backend_frontend_closed": {
        "name": "backend_frontend_closed",
        "title": "frontend_closed",
        "contentType": "application/json",
        "description": "A frontend connection ended. Relay-owned and backend-only; peers never send it.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "$ref": "#/components/schemas/frontend_closedMessage"
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        }
      },
      "frontend_aide_presence": {
        "name": "frontend_aide_presence",
        "title": "aide_presence",
        "contentType": "application/json",
        "description": "Relay-owned: the workspace backend connected (present:true) or went away (present:false). On either, read every open request's record and its events from the last applied cursor. Peers never send it.",
        "payload": {
          "$ref": "#/components/schemas/aide_presenceMessage"
        }
      },
      "frontend_session_page": {
        "name": "frontend_session_page",
        "title": "session_page",
        "contentType": "application/json",
        "description": "Offer a conversation for the viewed Coworld, or resolve the target after the user accepts.",
        "payload": {
          "$ref": "#/components/schemas/session_pageMessage"
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "frontend_session_page_result": {
        "name": "frontend_session_page_result",
        "title": "session_page_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "jsonrpc": {
              "const": "2.0"
            },
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "result": {
              "$ref": "#/components/schemas/session_pageResult"
            }
          },
          "required": [
            "jsonrpc",
            "id",
            "result"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "backend_session_page": {
        "name": "backend_session_page",
        "title": "session_page",
        "contentType": "application/json",
        "description": "Offer a conversation for the viewed Coworld, or resolve the target after the user accepts.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "$ref": "#/components/schemas/session_pageMessage"
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "backend_session_page_result": {
        "name": "backend_session_page_result",
        "title": "session_page_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "type": "object",
              "properties": {
                "jsonrpc": {
                  "const": "2.0"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "result": {
                  "$ref": "#/components/schemas/session_pageResult"
                }
              },
              "required": [
                "jsonrpc",
                "id",
                "result"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "frontend_surface_event": {
        "name": "frontend_surface_event",
        "title": "surface_event",
        "contentType": "application/json",
        "description": "Report an observation of how the frontend's own state is changing. The object travels in `data`, beside its `scope`, and is defined by the frontend and AIDE; the relay checks only that it is a JSON object.",
        "payload": {
          "$ref": "#/components/schemas/surface_eventMessage"
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "frontend_surface_event_result": {
        "name": "frontend_surface_event_result",
        "title": "surface_event_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "jsonrpc": {
              "const": "2.0"
            },
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "result": {
              "$ref": "#/components/schemas/surface_eventResult"
            }
          },
          "required": [
            "jsonrpc",
            "id",
            "result"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "backend_surface_event": {
        "name": "backend_surface_event",
        "title": "surface_event",
        "contentType": "application/json",
        "description": "Report an observation of how the frontend's own state is changing. The object travels in `data`, beside its `scope`, and is defined by the frontend and AIDE; the relay checks only that it is a JSON object.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "$ref": "#/components/schemas/surface_eventMessage"
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "backend_surface_event_result": {
        "name": "backend_surface_event_result",
        "title": "surface_event_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "type": "object",
              "properties": {
                "jsonrpc": {
                  "const": "2.0"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "result": {
                  "$ref": "#/components/schemas/surface_eventResult"
                }
              },
              "required": [
                "jsonrpc",
                "id",
                "result"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "frontend_surface_act": {
        "name": "frontend_surface_act",
        "title": "surface_act",
        "contentType": "application/json",
        "description": "Ask the frontend to apply an action to itself. The object travels in `data`, beside its `scope`, and is defined by AIDE and the frontend; the relay checks only that it is a JSON object. Never replay after reconnect.",
        "payload": {
          "$ref": "#/components/schemas/surface_actMessage"
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "frontend_surface_act_result": {
        "name": "frontend_surface_act_result",
        "title": "surface_act_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "jsonrpc": {
              "const": "2.0"
            },
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "result": {
              "$ref": "#/components/schemas/surface_actResult"
            }
          },
          "required": [
            "jsonrpc",
            "id",
            "result"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "backend_surface_act": {
        "name": "backend_surface_act",
        "title": "surface_act",
        "contentType": "application/json",
        "description": "Ask the frontend to apply an action to itself. The object travels in `data`, beside its `scope`, and is defined by AIDE and the frontend; the relay checks only that it is a JSON object. Never replay after reconnect.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "$ref": "#/components/schemas/surface_actMessage"
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "backend_surface_act_result": {
        "name": "backend_surface_act_result",
        "title": "surface_act_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "type": "object",
              "properties": {
                "jsonrpc": {
                  "const": "2.0"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "result": {
                  "$ref": "#/components/schemas/surface_actResult"
                }
              },
              "required": [
                "jsonrpc",
                "id",
                "result"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "frontend_clarification_request": {
        "name": "frontend_clarification_request",
        "title": "clarification_request",
        "contentType": "application/json",
        "description": "Ask the frontend a question without holding any work. The result only confirms the frontend took the question; the answer arrives later as clarification.response. Never replay after reconnect.",
        "payload": {
          "$ref": "#/components/schemas/clarification_requestMessage"
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "frontend_clarification_request_result": {
        "name": "frontend_clarification_request_result",
        "title": "clarification_request_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "jsonrpc": {
              "const": "2.0"
            },
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "result": {
              "$ref": "#/components/schemas/clarification_requestResult"
            }
          },
          "required": [
            "jsonrpc",
            "id",
            "result"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "backend_clarification_request": {
        "name": "backend_clarification_request",
        "title": "clarification_request",
        "contentType": "application/json",
        "description": "Ask the frontend a question without holding any work. The result only confirms the frontend took the question; the answer arrives later as clarification.response. Never replay after reconnect.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "$ref": "#/components/schemas/clarification_requestMessage"
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "backend_clarification_request_result": {
        "name": "backend_clarification_request_result",
        "title": "clarification_request_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "type": "object",
              "properties": {
                "jsonrpc": {
                  "const": "2.0"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "result": {
                  "$ref": "#/components/schemas/clarification_requestResult"
                }
              },
              "required": [
                "jsonrpc",
                "id",
                "result"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "frontend_clarification_response": {
        "name": "frontend_clarification_response",
        "title": "clarification_response",
        "contentType": "application/json",
        "description": "Answer a question asked with clarification.request. request_id is that request's outer id. An unwanted or differently answered question returns conflict; an unknown request_id returns not_found.",
        "payload": {
          "$ref": "#/components/schemas/clarification_responseMessage"
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "frontend_clarification_response_result": {
        "name": "frontend_clarification_response_result",
        "title": "clarification_response_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "jsonrpc": {
              "const": "2.0"
            },
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "result": {
              "$ref": "#/components/schemas/clarification_responseResult"
            }
          },
          "required": [
            "jsonrpc",
            "id",
            "result"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "backend_clarification_response": {
        "name": "backend_clarification_response",
        "title": "clarification_response",
        "contentType": "application/json",
        "description": "Answer a question asked with clarification.request. request_id is that request's outer id. An unwanted or differently answered question returns conflict; an unknown request_id returns not_found.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "$ref": "#/components/schemas/clarification_responseMessage"
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "backend_clarification_response_result": {
        "name": "backend_clarification_response_result",
        "title": "clarification_response_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "type": "object",
              "properties": {
                "jsonrpc": {
                  "const": "2.0"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "result": {
                  "$ref": "#/components/schemas/clarification_responseResult"
                }
              },
              "required": [
                "jsonrpc",
                "id",
                "result"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "frontend_policy_create": {
        "name": "frontend_policy_create",
        "title": "policy_create",
        "contentType": "application/json",
        "description": "Ask the frontend to deploy a new policy under name. An existing name returns conflict. Never replay after reconnect.",
        "payload": {
          "$ref": "#/components/schemas/policy_createMessage"
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "frontend_policy_create_result": {
        "name": "frontend_policy_create_result",
        "title": "policy_create_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "jsonrpc": {
              "const": "2.0"
            },
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "result": {
              "$ref": "#/components/schemas/policy_createResult"
            }
          },
          "required": [
            "jsonrpc",
            "id",
            "result"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "backend_policy_create": {
        "name": "backend_policy_create",
        "title": "policy_create",
        "contentType": "application/json",
        "description": "Ask the frontend to deploy a new policy under name. An existing name returns conflict. Never replay after reconnect.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "$ref": "#/components/schemas/policy_createMessage"
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "backend_policy_create_result": {
        "name": "backend_policy_create_result",
        "title": "policy_create_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "type": "object",
              "properties": {
                "jsonrpc": {
                  "const": "2.0"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "result": {
                  "$ref": "#/components/schemas/policy_createResult"
                }
              },
              "required": [
                "jsonrpc",
                "id",
                "result"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "frontend_policy_update": {
        "name": "frontend_policy_update",
        "title": "policy_update",
        "contentType": "application/json",
        "description": "Ask the frontend to deploy new content for the policy it holds under name. An unknown name returns not_found. Never replay after reconnect.",
        "payload": {
          "$ref": "#/components/schemas/policy_updateMessage"
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "frontend_policy_update_result": {
        "name": "frontend_policy_update_result",
        "title": "policy_update_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "jsonrpc": {
              "const": "2.0"
            },
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "result": {
              "$ref": "#/components/schemas/policy_updateResult"
            }
          },
          "required": [
            "jsonrpc",
            "id",
            "result"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "frontend_policy_list": {
        "name": "frontend_policy_list",
        "title": "policy_list",
        "contentType": "application/json",
        "description": "Ask the frontend which policies it holds in scope. Returns the name and deployed version of each. Read-only: safe to send again after reconnect.",
        "payload": {
          "$ref": "#/components/schemas/policy_listMessage"
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "frontend_policy_list_result": {
        "name": "frontend_policy_list_result",
        "title": "policy_list_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "jsonrpc": {
              "const": "2.0"
            },
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "result": {
              "$ref": "#/components/schemas/policy_listResult"
            }
          },
          "required": [
            "jsonrpc",
            "id",
            "result"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/id"
        }
      },
      "backend_policy_update": {
        "name": "backend_policy_update",
        "title": "policy_update",
        "contentType": "application/json",
        "description": "Ask the frontend to deploy new content for the policy it holds under name. An unknown name returns not_found. Never replay after reconnect.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "$ref": "#/components/schemas/policy_updateMessage"
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "backend_policy_update_result": {
        "name": "backend_policy_update_result",
        "title": "policy_update_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "type": "object",
              "properties": {
                "jsonrpc": {
                  "const": "2.0"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "result": {
                  "$ref": "#/components/schemas/policy_updateResult"
                }
              },
              "required": [
                "jsonrpc",
                "id",
                "result"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "backend_policy_list": {
        "name": "backend_policy_list",
        "title": "policy_list",
        "contentType": "application/json",
        "description": "Ask the frontend which policies it holds in scope. Returns the name and deployed version of each. Read-only: safe to send again after reconnect.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "$ref": "#/components/schemas/policy_listMessage"
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      },
      "backend_policy_list_result": {
        "name": "backend_policy_list_result",
        "title": "policy_list_result",
        "contentType": "application/json",
        "description": "Correlated success. Validate the result and target identity against the originating request.",
        "payload": {
          "type": "object",
          "properties": {
            "frontend_id": {
              "type": "string",
              "format": "uuid"
            },
            "message": {
              "type": "object",
              "properties": {
                "jsonrpc": {
                  "const": "2.0"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "result": {
                  "$ref": "#/components/schemas/policy_listResult"
                }
              },
              "required": [
                "jsonrpc",
                "id",
                "result"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "frontend_id",
            "message"
          ],
          "additionalProperties": false
        },
        "correlationId": {
          "location": "$message.payload#/message/id"
        }
      }
    }
  }
}
