{
  "openapi": "3.1.0",
  "info": {
    "title": "opencode",
    "version": "1.0.0",
    "description": "opencode api"
  },
  "paths": {
    "/auth/{providerID}": {
      "put": {
        "tags": ["control"],
        "operationId": "auth.set",
        "parameters": [
          {
            "name": "providerID",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully set authentication credentials",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "Successfully set authentication credentials"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Set authentication credentials",
        "summary": "Set auth credentials",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Auth"
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.set({\n  ...\n})"
          }
        ]
      },
      "delete": {
        "tags": ["control"],
        "operationId": "auth.remove",
        "parameters": [
          {
            "name": "providerID",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully removed authentication credentials",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "Successfully removed authentication credentials"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Remove authentication credentials",
        "summary": "Remove auth credentials",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.remove({\n  ...\n})"
          }
        ]
      }
    },
    "/log": {
      "post": {
        "tags": ["control"],
        "operationId": "app.log",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Log entry written successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "Log entry written successfully"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Write a log entry to the server logs with specified level and metadata.",
        "summary": "Write log",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "service": {
                    "type": "string",
                    "description": "Service name for the log entry"
                  },
                  "level": {
                    "type": "string",
                    "enum": ["debug", "info", "error", "warn"],
                    "description": "Log level"
                  },
                  "message": {
                    "type": "string",
                    "description": "Log message"
                  },
                  "extra": {
                    "type": "object"
                  }
                },
                "required": ["service", "level", "message"],
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.log({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/control-plane/move-session": {
      "post": {
        "tags": ["controlPlane"],
        "operationId": "experimental.controlPlane.moveSession",
        "parameters": [],
        "responses": {
          "204": {
            "description": "Session moved"
          },
          "400": {
            "description": "MoveSessionError | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/MoveSessionError"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Move a session to another project directory, optionally transferring local changes.",
        "summary": "Move session",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "destination": {
                    "$ref": "#/components/schemas/MoveSessionDestination"
                  },
                  "moveChanges": {
                    "type": "boolean"
                  }
                },
                "required": ["sessionID", "destination"],
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.controlPlane.moveSession({\n  ...\n})"
          }
        ]
      }
    },
    "/global/health": {
      "get": {
        "tags": ["global"],
        "operationId": "global.health",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Health information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "healthy": {
                      "type": "boolean",
                      "enum": [true]
                    },
                    "version": {
                      "type": "string"
                    }
                  },
                  "required": ["healthy", "version"],
                  "additionalProperties": false,
                  "description": "Health information"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Get health information about the OpenCode server.",
        "summary": "Get health",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.health({\n  ...\n})"
          }
        ]
      }
    },
    "/global/event": {
      "get": {
        "tags": ["global"],
        "operationId": "global.event",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Event stream",
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/GlobalEvent"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Subscribe to global events from the OpenCode system using server-sent events.",
        "summary": "Get global events",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.event({\n  ...\n})"
          }
        ]
      }
    },
    "/global/config": {
      "get": {
        "tags": ["global"],
        "operationId": "global.config.get",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Get global config info",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Config"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Retrieve the current global OpenCode configuration settings and preferences.",
        "summary": "Get global configuration",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.get({\n  ...\n})"
          }
        ]
      },
      "patch": {
        "tags": ["global"],
        "operationId": "global.config.update",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successfully updated global config",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Config"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Update global OpenCode configuration settings and preferences.",
        "summary": "Update global configuration",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Config"
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.update({\n  ...\n})"
          }
        ]
      }
    },
    "/global/dispose": {
      "post": {
        "tags": ["global"],
        "operationId": "global.dispose",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Global disposed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "Global disposed"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Clean up and dispose all OpenCode instances, releasing all resources.",
        "summary": "Dispose instance",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.dispose({\n  ...\n})"
          }
        ]
      }
    },
    "/global/upgrade": {
      "post": {
        "tags": ["global"],
        "operationId": "global.upgrade",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Upgrade result",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "type": "boolean",
                          "enum": [true]
                        },
                        "version": {
                          "type": "string"
                        }
                      },
                      "required": ["success", "version"],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "type": "boolean",
                          "enum": [false]
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": ["success", "error"],
                      "additionalProperties": false
                    }
                  ],
                  "description": "Upgrade result"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Upgrade opencode to the specified version or latest if not specified.",
        "summary": "Upgrade opencode",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "target": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.upgrade({\n  ...\n})"
          }
        ]
      }
    },
    "/event": {
      "get": {
        "tags": ["event"],
        "operationId": "event.subscribe",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Event stream",
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/Event"
                }
              }
            }
          }
        },
        "description": "Get events",
        "summary": "Subscribe to events",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.event.subscribe({\n  ...\n})"
          }
        ]
      }
    },
    "/config": {
      "get": {
        "tags": ["config"],
        "operationId": "config.get",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Get config info",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Config"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Retrieve the current OpenCode configuration settings and preferences.",
        "summary": "Get configuration",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.get({\n  ...\n})"
          }
        ]
      },
      "patch": {
        "tags": ["config"],
        "operationId": "config.update",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully updated config",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Config"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Update OpenCode configuration settings and preferences.",
        "summary": "Update configuration",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Config"
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.update({\n  ...\n})"
          }
        ]
      }
    },
    "/config/providers": {
      "get": {
        "tags": ["config"],
        "operationId": "config.providers",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "List of providers",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "providers": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Provider"
                      }
                    },
                    "default": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      }
                    }
                  },
                  "required": ["providers", "default"],
                  "additionalProperties": false,
                  "description": "List of providers"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Get a list of all configured AI providers and their default models.",
        "summary": "List config providers",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.providers({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/capabilities": {
      "get": {
        "tags": ["experimental"],
        "operationId": "experimental.capabilities.get",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Experimental capabilities",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExperimentalCapabilities"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Get experimental features enabled on the OpenCode server.",
        "summary": "Get experimental capabilities",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.capabilities.get({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/console": {
      "get": {
        "tags": ["experimental"],
        "operationId": "experimental.console.get",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Active Console provider metadata",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsoleState"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/effect_HttpApiError_InternalServerError"
                }
              }
            }
          }
        },
        "description": "Get the active Console org name and the set of provider IDs managed by that Console org.",
        "summary": "Get active Console provider metadata",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.get({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/console/orgs": {
      "get": {
        "tags": ["experimental"],
        "operationId": "experimental.console.listOrgs",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Switchable Console orgs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "orgs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "accountID": {
                            "type": "string"
                          },
                          "accountEmail": {
                            "type": "string"
                          },
                          "accountUrl": {
                            "type": "string"
                          },
                          "orgID": {
                            "type": "string"
                          },
                          "orgName": {
                            "type": "string"
                          },
                          "active": {
                            "type": "boolean"
                          }
                        },
                        "required": ["accountID", "accountEmail", "accountUrl", "orgID", "orgName", "active"],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": ["orgs"],
                  "additionalProperties": false,
                  "description": "Switchable Console orgs"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/effect_HttpApiError_InternalServerError"
                }
              }
            }
          }
        },
        "description": "Get the available Console orgs across logged-in accounts, including the current active org.",
        "summary": "List switchable Console orgs",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.listOrgs({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/console/switch": {
      "post": {
        "tags": ["experimental"],
        "operationId": "experimental.console.switchOrg",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Switch success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "Switch success"
                }
              }
            }
          }
        },
        "description": "Persist a new active Console account/org selection for the current local OpenCode state.",
        "summary": "Switch active Console org",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "accountID": {
                    "type": "string"
                  },
                  "orgID": {
                    "type": "string"
                  }
                },
                "required": ["accountID", "orgID"],
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.switchOrg({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/tool": {
      "get": {
        "tags": ["experimental"],
        "operationId": "tool.list",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "provider",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "model",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Tools",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolList"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Get a list of available tools with their JSON schema parameters for a specific provider and model combination.",
        "summary": "List tools",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.list({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/tool/ids": {
      "get": {
        "tags": ["experimental"],
        "operationId": "tool.ids",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Tool IDs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolIDs"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Get a list of all available tool IDs, including both built-in tools and dynamically registered tools.",
        "summary": "List tool IDs",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.ids({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/worktree": {
      "get": {
        "tags": ["experimental"],
        "operationId": "worktree.list",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "List of worktree directories",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "List of worktree directories"
                }
              }
            }
          },
          "400": {
            "description": "WorktreeError | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/WorktreeError"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "List all sandbox worktrees for the current project.",
        "summary": "List worktrees",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.list({\n  ...\n})"
          }
        ]
      },
      "post": {
        "tags": ["experimental"],
        "operationId": "worktree.create",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Worktree created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Worktree"
                }
              }
            }
          },
          "400": {
            "description": "WorktreeError | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/WorktreeError"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Create a new git worktree for the current project and run any configured startup scripts.",
        "summary": "Create worktree",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorktreeCreateInput"
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.create({\n  ...\n})"
          }
        ]
      },
      "delete": {
        "tags": ["experimental"],
        "operationId": "worktree.remove",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Worktree removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "Worktree removed"
                }
              }
            }
          },
          "400": {
            "description": "WorktreeError | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/WorktreeError"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Remove a git worktree and delete its branch.",
        "summary": "Remove worktree",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorktreeRemoveInput"
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.remove({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/worktree/reset": {
      "post": {
        "tags": ["experimental"],
        "operationId": "worktree.reset",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Worktree reset",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "Worktree reset"
                }
              }
            }
          },
          "400": {
            "description": "WorktreeError | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/WorktreeError"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Reset a worktree branch to the primary default branch.",
        "summary": "Reset worktree",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorktreeResetInput"
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.reset({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/session": {
      "get": {
        "tags": ["experimental"],
        "operationId": "experimental.session.list",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "roots",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "string",
                  "enum": ["true", "false"]
                }
              ]
            },
            "required": false
          },
          {
            "name": "start",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "required": false
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "required": false
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "required": false
          },
          {
            "name": "archived",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "string",
                  "enum": ["true", "false"]
                }
              ]
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "List of sessions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GlobalSession"
                  },
                  "description": "List of sessions"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.",
        "summary": "List sessions",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.session.list({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/session/{sessionID}/background": {
      "post": {
        "tags": ["experimental"],
        "operationId": "experimental.session.background",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Backgrounded subagents",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "Backgrounded subagents"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Detach any synchronous subagents currently blocking the session and continue them in the background.",
        "summary": "Background subagents",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.session.background({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/resource": {
      "get": {
        "tags": ["experimental"],
        "operationId": "experimental.resource.list",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "MCP resources",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "$ref": "#/components/schemas/McpResource"
                  },
                  "description": "MCP resources"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Get all available MCP resources from connected servers. Optionally filter by name.",
        "summary": "Get MCP resources",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.resource.list({\n  ...\n})"
          }
        ]
      }
    },
    "/find": {
      "get": {
        "tags": ["file"],
        "operationId": "find.text",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "pattern",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Matches",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "path": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string"
                          }
                        },
                        "required": ["text"],
                        "additionalProperties": false
                      },
                      "lines": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string"
                          }
                        },
                        "required": ["text"],
                        "additionalProperties": false
                      },
                      "line_number": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "absolute_offset": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "submatches": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "match": {
                              "type": "object",
                              "properties": {
                                "text": {
                                  "type": "string"
                                }
                              },
                              "required": ["text"],
                              "additionalProperties": false
                            },
                            "start": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "end": {
                              "type": "integer",
                              "minimum": 0
                            }
                          },
                          "required": ["match", "start", "end"],
                          "additionalProperties": false
                        }
                      }
                    },
                    "required": ["path", "lines", "line_number", "absolute_offset", "submatches"],
                    "additionalProperties": false
                  },
                  "description": "Matches"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Search for text patterns across files in the project using ripgrep.",
        "summary": "Find text",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.text({\n  ...\n})"
          }
        ]
      }
    },
    "/find/file": {
      "get": {
        "tags": ["file"],
        "operationId": "find.files",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "query",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "dirs",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": ["true", "false"]
            },
            "required": false
          },
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": ["file", "directory"]
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "File paths",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "File paths"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Search for files or directories by name or pattern in the project directory.",
        "summary": "Find files",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.files({\n  ...\n})"
          }
        ]
      }
    },
    "/find/symbol": {
      "get": {
        "tags": ["file"],
        "operationId": "find.symbols",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "query",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Symbols",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Symbol"
                  },
                  "description": "Symbols"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Search for workspace symbols like functions, classes, and variables using LSP.",
        "summary": "Find symbols",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.symbols({\n  ...\n})"
          }
        ]
      }
    },
    "/file": {
      "get": {
        "tags": ["file"],
        "operationId": "file.list",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "path",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Files and directories",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FileNode"
                  },
                  "description": "Files and directories"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "List files and directories in a specified path.",
        "summary": "List files",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.list({\n  ...\n})"
          }
        ]
      }
    },
    "/file/content": {
      "get": {
        "tags": ["file"],
        "operationId": "file.read",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "path",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "File content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileContent"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Read the content of a specified file.",
        "summary": "Read file",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.read({\n  ...\n})"
          }
        ]
      }
    },
    "/file/status": {
      "get": {
        "tags": ["file"],
        "operationId": "file.status",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "File status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/File"
                  },
                  "description": "File status"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Get the git status of all files in the project.",
        "summary": "Get file status",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.status({\n  ...\n})"
          }
        ]
      }
    },
    "/instance/dispose": {
      "post": {
        "tags": ["instance"],
        "operationId": "instance.dispose",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Instance disposed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "Instance disposed"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Clean up and dispose the current OpenCode instance, releasing all resources.",
        "summary": "Dispose instance",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.instance.dispose({\n  ...\n})"
          }
        ]
      }
    },
    "/path": {
      "get": {
        "tags": ["instance"],
        "operationId": "path.get",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Path",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Path"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Retrieve the current working directory and related path information for the OpenCode instance.",
        "summary": "Get paths",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.path.get({\n  ...\n})"
          }
        ]
      }
    },
    "/vcs": {
      "get": {
        "tags": ["instance"],
        "operationId": "vcs.get",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "VCS info",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VcsInfo"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Retrieve version control system (VCS) information for the current project, such as git branch.",
        "summary": "Get VCS info",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.get({\n  ...\n})"
          }
        ]
      }
    },
    "/vcs/status": {
      "get": {
        "tags": ["instance"],
        "operationId": "vcs.status",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "VCS status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VcsFileStatus"
                  },
                  "description": "VCS status"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Retrieve changed files in the current working tree without patches.",
        "summary": "Get VCS status",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.status({\n  ...\n})"
          }
        ]
      }
    },
    "/vcs/diff": {
      "get": {
        "tags": ["instance"],
        "operationId": "vcs.diff",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "mode",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": ["git", "branch"]
            },
            "required": true
          },
          {
            "name": "context",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "VCS diff",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VcsFileDiff"
                  },
                  "description": "VCS diff"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Retrieve the current git diff for the working tree or against the default branch.",
        "summary": "Get VCS diff",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.diff({\n  ...\n})"
          }
        ]
      }
    },
    "/vcs/diff/raw": {
      "get": {
        "tags": ["instance"],
        "operationId": "vcs.diff.raw",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Raw VCS diff",
            "content": {
              "text/x-diff; charset=utf-8": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Retrieve a raw patch for current uncommitted changes.",
        "summary": "Get raw VCS diff",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.diff.raw({\n  ...\n})"
          }
        ]
      }
    },
    "/vcs/apply": {
      "post": {
        "tags": ["instance"],
        "operationId": "vcs.apply",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "VCS patch applied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "applied": {
                      "type": "boolean"
                    }
                  },
                  "required": ["applied"],
                  "additionalProperties": false,
                  "description": "VCS patch applied"
                }
              }
            }
          },
          "400": {
            "description": "VcsApplyError | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/VcsApplyError"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Apply a raw patch to the current working tree.",
        "summary": "Apply VCS patch",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "patch": {
                    "type": "string"
                  }
                },
                "required": ["patch"],
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.apply({\n  ...\n})"
          }
        ]
      }
    },
    "/command": {
      "get": {
        "tags": ["instance"],
        "operationId": "command.list",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "List of commands",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Command"
                  },
                  "description": "List of commands"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Get a list of all available commands in the OpenCode system.",
        "summary": "List commands",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.command.list({\n  ...\n})"
          }
        ]
      }
    },
    "/agent": {
      "get": {
        "tags": ["instance"],
        "operationId": "app.agents",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "List of agents",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Agent"
                  },
                  "description": "List of agents"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Get a list of all available AI agents in the OpenCode system.",
        "summary": "List agents",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.agents({\n  ...\n})"
          }
        ]
      }
    },
    "/skill": {
      "get": {
        "tags": ["instance"],
        "operationId": "app.skills",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "List of skills",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "location": {
                        "type": "string"
                      },
                      "content": {
                        "type": "string"
                      }
                    },
                    "required": ["name", "location", "content"],
                    "additionalProperties": false
                  },
                  "description": "List of skills"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Get a list of all available skills in the OpenCode system.",
        "summary": "List skills",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.skills({\n  ...\n})"
          }
        ]
      }
    },
    "/lsp": {
      "get": {
        "tags": ["instance"],
        "operationId": "lsp.status",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "LSP server status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LSPStatus"
                  },
                  "description": "LSP server status"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Get LSP server status",
        "summary": "Get LSP status",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.lsp.status({\n  ...\n})"
          }
        ]
      }
    },
    "/formatter": {
      "get": {
        "tags": ["instance"],
        "operationId": "formatter.status",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Formatter status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FormatterStatus"
                  },
                  "description": "Formatter status"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Get formatter status",
        "summary": "Get formatter status",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.formatter.status({\n  ...\n})"
          }
        ]
      }
    },
    "/mcp": {
      "get": {
        "tags": ["mcp"],
        "operationId": "mcp.status",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "MCP server status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "$ref": "#/components/schemas/MCPStatus"
                  },
                  "description": "MCP server status"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Get the status of all Model Context Protocol (MCP) servers.",
        "summary": "Get MCP status",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.status({\n  ...\n})"
          }
        ]
      },
      "post": {
        "tags": ["mcp"],
        "operationId": "mcp.add",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "MCP server added successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "$ref": "#/components/schemas/MCPStatus"
                  },
                  "description": "MCP server added successfully"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Dynamically add a new Model Context Protocol (MCP) server to the system.",
        "summary": "Add MCP server",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "config": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/McpLocalConfig"
                      },
                      {
                        "$ref": "#/components/schemas/McpRemoteConfig"
                      }
                    ]
                  }
                },
                "required": ["name", "config"],
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.add({\n  ...\n})"
          }
        ]
      }
    },
    "/mcp/{name}/auth": {
      "post": {
        "tags": ["mcp"],
        "operationId": "mcp.auth.start",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "OAuth flow started",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "authorizationUrl": {
                      "type": "string"
                    },
                    "oauthState": {
                      "type": "string"
                    }
                  },
                  "required": ["authorizationUrl", "oauthState"],
                  "additionalProperties": false,
                  "description": "OAuth flow started"
                }
              }
            }
          },
          "400": {
            "description": "McpUnsupportedOAuthError | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/McpUnsupportedOAuthError"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "McpServerNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpServerNotFoundError"
                }
              }
            }
          }
        },
        "description": "Start OAuth authentication flow for a Model Context Protocol (MCP) server.",
        "summary": "Start MCP OAuth",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.start({\n  ...\n})"
          }
        ]
      },
      "delete": {
        "tags": ["mcp"],
        "operationId": "mcp.auth.remove",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "OAuth credentials removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [true]
                    }
                  },
                  "required": ["success"],
                  "additionalProperties": false,
                  "description": "OAuth credentials removed"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "McpServerNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpServerNotFoundError"
                }
              }
            }
          }
        },
        "description": "Remove OAuth credentials for an MCP server.",
        "summary": "Remove MCP OAuth",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.remove({\n  ...\n})"
          }
        ]
      }
    },
    "/mcp/{name}/auth/callback": {
      "post": {
        "tags": ["mcp"],
        "operationId": "mcp.auth.callback",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "OAuth authentication completed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MCPStatus"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "McpServerNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpServerNotFoundError"
                }
              }
            }
          }
        },
        "description": "Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.",
        "summary": "Complete MCP OAuth",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string"
                  }
                },
                "required": ["code"],
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.callback({\n  ...\n})"
          }
        ]
      }
    },
    "/mcp/{name}/auth/authenticate": {
      "post": {
        "tags": ["mcp"],
        "operationId": "mcp.auth.authenticate",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "OAuth authentication completed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MCPStatus"
                }
              }
            }
          },
          "400": {
            "description": "McpUnsupportedOAuthError | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/McpUnsupportedOAuthError"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "McpServerNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpServerNotFoundError"
                }
              }
            }
          }
        },
        "description": "Start OAuth flow and wait for callback (opens browser).",
        "summary": "Authenticate MCP OAuth",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.authenticate({\n  ...\n})"
          }
        ]
      }
    },
    "/mcp/{name}/connect": {
      "post": {
        "tags": ["mcp"],
        "operationId": "mcp.connect",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "MCP server connected successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "MCP server connected successfully"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "McpServerNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpServerNotFoundError"
                }
              }
            }
          }
        },
        "description": "Connect an MCP server.",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.connect({\n  ...\n})"
          }
        ]
      }
    },
    "/mcp/{name}/disconnect": {
      "post": {
        "tags": ["mcp"],
        "operationId": "mcp.disconnect",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "MCP server disconnected successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "MCP server disconnected successfully"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "McpServerNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpServerNotFoundError"
                }
              }
            }
          }
        },
        "description": "Disconnect an MCP server.",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.disconnect({\n  ...\n})"
          }
        ]
      }
    },
    "/project": {
      "get": {
        "tags": ["project"],
        "operationId": "project.list",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "List of projects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Project"
                  },
                  "description": "List of projects"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Get a list of projects that have been opened with OpenCode.",
        "summary": "List all projects",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.list({\n  ...\n})"
          }
        ]
      }
    },
    "/project/current": {
      "get": {
        "tags": ["project"],
        "operationId": "project.current",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Current project information",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Retrieve the currently active project that OpenCode is working with.",
        "summary": "Get current project",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.current({\n  ...\n})"
          }
        ]
      }
    },
    "/project/git/init": {
      "post": {
        "tags": ["project"],
        "operationId": "project.initGit",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Project information after git initialization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Create a git repository for the current project and return the refreshed project info.",
        "summary": "Initialize git repository",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.initGit({\n  ...\n})"
          }
        ]
      }
    },
    "/project/{projectID}": {
      "patch": {
        "tags": ["project"],
        "operationId": "project.update",
        "parameters": [
          {
            "name": "projectID",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Updated project information",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "ProjectNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectNotFoundError"
                }
              }
            }
          }
        },
        "description": "Update project properties such as name, icon, and commands.",
        "summary": "Update project",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "icon": {
                    "$ref": "#/components/schemas/ProjectIcon"
                  },
                  "commands": {
                    "$ref": "#/components/schemas/ProjectCommands"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.update({\n  ...\n})"
          }
        ]
      }
    },
    "/project/{projectID}/directories": {
      "get": {
        "tags": ["project"],
        "operationId": "project.directories",
        "parameters": [
          {
            "name": "projectID",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Project directories",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectDirectories"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "List known local absolute directories for a project.",
        "summary": "List project directories",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.directories({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/project/{projectID}/copy/generate-name": {
      "post": {
        "tags": ["projectCopy"],
        "operationId": "experimental.projectCopy.generateName",
        "parameters": [
          {
            "name": "projectID",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    }
                  },
                  "required": ["name"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Generate a short name for a project copy from task context.",
        "summary": "Generate project copy name",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "context": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.projectCopy.generateName({\n  ...\n})"
          }
        ]
      }
    },
    "/pty/shells": {
      "get": {
        "tags": ["pty"],
        "operationId": "pty.shells",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "List of shells",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "path": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "acceptable": {
                        "type": "boolean"
                      }
                    },
                    "required": ["path", "name", "acceptable"],
                    "additionalProperties": false
                  },
                  "description": "List of shells"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Get a list of available shells on the system.",
        "summary": "List available shells",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.shells({\n  ...\n})"
          }
        ]
      }
    },
    "/pty": {
      "get": {
        "tags": ["pty"],
        "operationId": "pty.list",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "List of sessions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Pty"
                  },
                  "description": "List of sessions"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.",
        "summary": "List PTY sessions",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.list({\n  ...\n})"
          }
        ]
      },
      "post": {
        "tags": ["pty"],
        "operationId": "pty.create",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Created session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pty"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Create a new pseudo-terminal (PTY) session for running shell commands and processes.",
        "summary": "Create PTY session",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "command": {
                    "type": "string"
                  },
                  "args": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "cwd": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  },
                  "env": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.create({\n  ...\n})"
          }
        ]
      }
    },
    "/pty/{ptyID}": {
      "get": {
        "tags": ["pty"],
        "operationId": "pty.get",
        "parameters": [
          {
            "name": "ptyID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^pty"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Session info",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pty"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "PtyNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PtyNotFoundError"
                }
              }
            }
          }
        },
        "description": "Retrieve detailed information about a specific pseudo-terminal (PTY) session.",
        "summary": "Get PTY session",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.get({\n  ...\n})"
          }
        ]
      },
      "put": {
        "tags": ["pty"],
        "operationId": "pty.update",
        "parameters": [
          {
            "name": "ptyID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^pty"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Updated session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pty"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "PtyNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PtyNotFoundError"
                }
              }
            }
          }
        },
        "description": "Update properties of an existing pseudo-terminal (PTY) session.",
        "summary": "Update PTY session",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string"
                  },
                  "size": {
                    "type": "object",
                    "properties": {
                      "rows": {
                        "type": "integer",
                        "exclusiveMinimum": 0
                      },
                      "cols": {
                        "type": "integer",
                        "exclusiveMinimum": 0
                      }
                    },
                    "required": ["rows", "cols"],
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.update({\n  ...\n})"
          }
        ]
      },
      "delete": {
        "tags": ["pty"],
        "operationId": "pty.remove",
        "parameters": [
          {
            "name": "ptyID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^pty"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Session removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "Session removed"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "PtyNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PtyNotFoundError"
                }
              }
            }
          }
        },
        "description": "Remove and terminate a specific pseudo-terminal (PTY) session.",
        "summary": "Remove PTY session",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.remove({\n  ...\n})"
          }
        ]
      }
    },
    "/pty/{ptyID}/connect-token": {
      "post": {
        "tags": ["pty"],
        "operationId": "pty.connectToken",
        "parameters": [
          {
            "name": "ptyID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^pty"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "WebSocket connect token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PtyTicketConnectToken"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "403": {
            "description": "PtyForbiddenError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PtyForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "PtyNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PtyNotFoundError"
                }
              }
            }
          }
        },
        "description": "Create a short-lived ticket for opening a PTY WebSocket connection.",
        "summary": "Create PTY WebSocket token",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connectToken({\n  ...\n})"
          }
        ]
      }
    },
    "/question": {
      "get": {
        "tags": ["question"],
        "operationId": "question.list",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "List of pending questions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/QuestionRequest"
                  },
                  "description": "List of pending questions"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Get all pending question requests across all sessions.",
        "summary": "List pending questions",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.list({\n  ...\n})"
          }
        ]
      }
    },
    "/question/{requestID}/reply": {
      "post": {
        "tags": ["question"],
        "operationId": "question.reply",
        "parameters": [
          {
            "name": "requestID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^que"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Question answered successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "Question answered successfully"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "QuestionNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionNotFoundError"
                }
              }
            }
          }
        },
        "description": "Provide answers to a question request from the AI assistant.",
        "summary": "Reply to question request",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "answers": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/QuestionAnswer"
                    },
                    "description": "User answers in order of questions (each answer is an array of selected labels)"
                  }
                },
                "required": ["answers"],
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reply({\n  ...\n})"
          }
        ]
      }
    },
    "/question/{requestID}/reject": {
      "post": {
        "tags": ["question"],
        "operationId": "question.reject",
        "parameters": [
          {
            "name": "requestID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^que"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Question rejected successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "Question rejected successfully"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "QuestionNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionNotFoundError"
                }
              }
            }
          }
        },
        "description": "Reject a question request from the AI assistant.",
        "summary": "Reject question request",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reject({\n  ...\n})"
          }
        ]
      }
    },
    "/permission": {
      "get": {
        "tags": ["permission"],
        "operationId": "permission.list",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "List of pending permissions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PermissionRequest"
                  },
                  "description": "List of pending permissions"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Get all pending permission requests across all sessions.",
        "summary": "List pending permissions",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.list({\n  ...\n})"
          }
        ]
      }
    },
    "/permission/{requestID}/reply": {
      "post": {
        "tags": ["permission"],
        "operationId": "permission.reply",
        "parameters": [
          {
            "name": "requestID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^per"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Permission processed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "Permission processed successfully"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "PermissionNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PermissionNotFoundError"
                }
              }
            }
          }
        },
        "description": "Approve or deny a permission request from the AI assistant.",
        "summary": "Respond to permission request",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reply": {
                    "type": "string",
                    "enum": ["once", "always", "reject"]
                  },
                  "message": {
                    "type": "string"
                  }
                },
                "required": ["reply"],
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.reply({\n  ...\n})"
          }
        ]
      }
    },
    "/provider": {
      "get": {
        "tags": ["provider"],
        "operationId": "provider.list",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "List of providers",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "all": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Provider"
                      }
                    },
                    "default": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      }
                    },
                    "connected": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": ["all", "default", "connected"],
                  "additionalProperties": false,
                  "description": "List of providers"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Get a list of all available AI providers, including both available and connected ones.",
        "summary": "List providers",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.list({\n  ...\n})"
          }
        ]
      }
    },
    "/provider/auth": {
      "get": {
        "tags": ["provider"],
        "operationId": "provider.auth",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Provider auth methods",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/ProviderAuthMethod"
                    }
                  },
                  "description": "Provider auth methods"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Retrieve available authentication methods for all AI providers.",
        "summary": "Get provider auth methods",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.auth({\n  ...\n})"
          }
        ]
      }
    },
    "/provider/{providerID}/oauth/authorize": {
      "post": {
        "tags": ["provider"],
        "operationId": "provider.oauth.authorize",
        "parameters": [
          {
            "name": "providerID",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Authorization URL and method",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderAuthAuthorization"
                }
              }
            }
          },
          "400": {
            "description": "ProviderAuthError | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ProviderAuthError1"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Start the OAuth authorization flow for a provider.",
        "summary": "Start OAuth authorization",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "method": {
                    "type": "number",
                    "description": "Auth method index"
                  },
                  "inputs": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  }
                },
                "required": ["method"],
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.authorize({\n  ...\n})"
          }
        ]
      }
    },
    "/provider/{providerID}/oauth/callback": {
      "post": {
        "tags": ["provider"],
        "operationId": "provider.oauth.callback",
        "parameters": [
          {
            "name": "providerID",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "OAuth callback processed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "OAuth callback processed successfully"
                }
              }
            }
          },
          "400": {
            "description": "ProviderAuthError | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ProviderAuthError1"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Handle the OAuth callback from a provider after user authorization.",
        "summary": "Handle OAuth callback",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "method": {
                    "type": "number",
                    "description": "Auth method index"
                  },
                  "code": {
                    "type": "string"
                  }
                },
                "required": ["method"],
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.callback({\n  ...\n})"
          }
        ]
      }
    },
    "/session": {
      "get": {
        "tags": ["session"],
        "operationId": "session.list",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "scope",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": ["project"]
            },
            "required": false
          },
          {
            "name": "path",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "roots",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "string",
                  "enum": ["true", "false"]
                }
              ]
            },
            "required": false
          },
          {
            "name": "start",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "required": false
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "List of sessions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Session"
                  },
                  "description": "List of sessions"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Get a list of all OpenCode sessions, sorted by most recently updated.",
        "summary": "List sessions",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.list({\n  ...\n})"
          }
        ]
      },
      "post": {
        "tags": ["session"],
        "operationId": "session.create",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully created session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Create a new OpenCode session for interacting with AI assistants and managing conversations.",
        "summary": "Create session",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "parentID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "title": {
                    "type": "string"
                  },
                  "agent": {
                    "type": "string"
                  },
                  "model": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "providerID": {
                        "type": "string"
                      },
                      "variant": {
                        "type": "string"
                      }
                    },
                    "required": ["id", "providerID"],
                    "additionalProperties": false
                  },
                  "metadata": {
                    "type": "object"
                  },
                  "permission": {
                    "$ref": "#/components/schemas/PermissionRuleset"
                  },
                  "workspaceID": {
                    "type": "string",
                    "pattern": "^wrk"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.create({\n  ...\n})"
          }
        ]
      }
    },
    "/session/status": {
      "get": {
        "tags": ["session"],
        "operationId": "session.status",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Get session status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "$ref": "#/components/schemas/SessionStatus"
                  },
                  "description": "Get session status"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Retrieve the current status of all sessions, including active, idle, and completed states.",
        "summary": "Get session status",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.status({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}": {
      "get": {
        "tags": ["session"],
        "operationId": "session.get",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Get session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "NotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "description": "Retrieve detailed information about a specific OpenCode session.",
        "summary": "Get session",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.get({\n  ...\n})"
          }
        ]
      },
      "delete": {
        "tags": ["session"],
        "operationId": "session.delete",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully deleted session",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "Successfully deleted session"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "NotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "description": "Delete a session and permanently remove all associated data, including messages and history.",
        "summary": "Delete session",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.delete({\n  ...\n})"
          }
        ]
      },
      "patch": {
        "tags": ["session"],
        "operationId": "session.update",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully updated session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "NotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "description": "Update properties of an existing session, such as title or other metadata.",
        "summary": "Update session",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string"
                  },
                  "metadata": {
                    "type": "object"
                  },
                  "permission": {
                    "$ref": "#/components/schemas/PermissionRuleset"
                  },
                  "time": {
                    "type": "object",
                    "properties": {
                      "archived": {
                        "type": "number"
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.update({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/children": {
      "get": {
        "tags": ["session"],
        "operationId": "session.children",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "List of children",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Session"
                  },
                  "description": "List of children"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "NotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "description": "Retrieve all child sessions that were forked from the specified parent session.",
        "summary": "Get session children",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.children({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/diff": {
      "get": {
        "tags": ["session"],
        "operationId": "session.diff",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "messageID",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^msg"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved diff",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SnapshotFileDiff"
                  },
                  "description": "Successfully retrieved diff"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Get the file changes (diff) that resulted from a specific user message in the session.",
        "summary": "Get message diff",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.diff({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/message": {
      "get": {
        "tags": ["session"],
        "operationId": "session.messages",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "required": false
          },
          {
            "name": "before",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "List of messages",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "info": {
                        "$ref": "#/components/schemas/Message"
                      },
                      "parts": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/Part"
                        }
                      }
                    },
                    "required": ["info", "parts"],
                    "additionalProperties": false
                  },
                  "description": "List of messages"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "NotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "description": "Retrieve all messages in a session, including user prompts and AI responses.",
        "summary": "Get session messages",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.messages({\n  ...\n})"
          }
        ]
      },
      "post": {
        "tags": ["session"],
        "operationId": "session.prompt",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Created message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["info", "parts"],
                  "properties": {
                    "info": {
                      "$ref": "#/components/schemas/AssistantMessage"
                    },
                    "parts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Part"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "NotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "description": "Create and send a new message to a session, streaming the AI response.",
        "summary": "Send message",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "messageID": {
                    "type": "string",
                    "pattern": "^msg"
                  },
                  "model": {
                    "type": "object",
                    "properties": {
                      "providerID": {
                        "type": "string"
                      },
                      "modelID": {
                        "type": "string"
                      }
                    },
                    "required": ["providerID", "modelID"],
                    "additionalProperties": false
                  },
                  "agent": {
                    "type": "string"
                  },
                  "noReply": {
                    "type": "boolean"
                  },
                  "tools": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "boolean"
                    }
                  },
                  "format": {
                    "$ref": "#/components/schemas/OutputFormat"
                  },
                  "system": {
                    "type": "string"
                  },
                  "variant": {
                    "type": "string"
                  },
                  "parts": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/TextPartInput"
                        },
                        {
                          "$ref": "#/components/schemas/FilePartInput"
                        },
                        {
                          "$ref": "#/components/schemas/AgentPartInput"
                        },
                        {
                          "$ref": "#/components/schemas/SubtaskPartInput"
                        }
                      ]
                    }
                  }
                },
                "required": ["parts"],
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/message/{messageID}": {
      "get": {
        "tags": ["session"],
        "operationId": "session.message",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          },
          {
            "name": "messageID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^msg"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "info": {
                      "$ref": "#/components/schemas/Message"
                    },
                    "parts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Part"
                      }
                    }
                  },
                  "required": ["info", "parts"],
                  "additionalProperties": false,
                  "description": "Message"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "NotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "description": "Retrieve a specific message from a session by its message ID.",
        "summary": "Get message",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.message({\n  ...\n})"
          }
        ]
      },
      "delete": {
        "tags": ["session"],
        "operationId": "session.deleteMessage",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          },
          {
            "name": "messageID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^msg"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully deleted message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "Successfully deleted message"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "NotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "SessionBusyError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionBusyError"
                }
              }
            }
          }
        },
        "description": "Permanently delete a specific message and all of its parts from a session without reverting file changes.",
        "summary": "Delete message",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.deleteMessage({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/fork": {
      "post": {
        "tags": ["session"],
        "operationId": "session.fork",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "NotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "description": "Create a new session by forking an existing session at a specific message point.",
        "summary": "Fork session",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "messageID": {
                    "type": "string",
                    "pattern": "^msg"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.fork({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/abort": {
      "post": {
        "tags": ["session"],
        "operationId": "session.abort",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Aborted session",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "Aborted session"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Abort an active session and stop any ongoing AI processing or command execution.",
        "summary": "Abort session",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.abort({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/init": {
      "post": {
        "tags": ["session"],
        "operationId": "session.init",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "200"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "NotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "description": "Analyze the current application and create an AGENTS.md file with project-specific agent configurations.",
        "summary": "Initialize session",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "modelID": {
                    "type": "string"
                  },
                  "providerID": {
                    "type": "string"
                  },
                  "messageID": {
                    "type": "string",
                    "pattern": "^msg"
                  }
                },
                "required": ["modelID", "providerID", "messageID"],
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.init({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/share": {
      "post": {
        "tags": ["session"],
        "operationId": "session.share",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully shared session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "NotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/effect_HttpApiError_InternalServerError"
                }
              }
            }
          }
        },
        "description": "Create a shareable link for a session, allowing others to view the conversation.",
        "summary": "Share session",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.share({\n  ...\n})"
          }
        ]
      },
      "delete": {
        "tags": ["session"],
        "operationId": "session.unshare",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully unshared session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "NotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/effect_HttpApiError_InternalServerError"
                }
              }
            }
          }
        },
        "description": "Remove the shareable link for a session, making it private again.",
        "summary": "Unshare session",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unshare({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/summarize": {
      "post": {
        "tags": ["session"],
        "operationId": "session.summarize",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Summarized session",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "Summarized session"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "NotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "description": "Generate a concise summary of the session using AI compaction to preserve key information.",
        "summary": "Summarize session",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "providerID": {
                    "type": "string"
                  },
                  "modelID": {
                    "type": "string"
                  },
                  "auto": {
                    "type": "boolean"
                  }
                },
                "required": ["providerID", "modelID"],
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.summarize({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/prompt_async": {
      "post": {
        "tags": ["session"],
        "operationId": "session.prompt_async",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "204": {
            "description": "Prompt accepted"
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "NotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "description": "Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.",
        "summary": "Send async message",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "messageID": {
                    "type": "string",
                    "pattern": "^msg"
                  },
                  "model": {
                    "type": "object",
                    "properties": {
                      "providerID": {
                        "type": "string"
                      },
                      "modelID": {
                        "type": "string"
                      }
                    },
                    "required": ["providerID", "modelID"],
                    "additionalProperties": false
                  },
                  "agent": {
                    "type": "string"
                  },
                  "noReply": {
                    "type": "boolean"
                  },
                  "tools": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "boolean"
                    }
                  },
                  "format": {
                    "$ref": "#/components/schemas/OutputFormat"
                  },
                  "system": {
                    "type": "string"
                  },
                  "variant": {
                    "type": "string"
                  },
                  "parts": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/TextPartInput"
                        },
                        {
                          "$ref": "#/components/schemas/FilePartInput"
                        },
                        {
                          "$ref": "#/components/schemas/AgentPartInput"
                        },
                        {
                          "$ref": "#/components/schemas/SubtaskPartInput"
                        }
                      ]
                    }
                  }
                },
                "required": ["parts"],
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt_async({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/command": {
      "post": {
        "tags": ["session"],
        "operationId": "session.command",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Created message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["info", "parts"],
                  "properties": {
                    "info": {
                      "$ref": "#/components/schemas/AssistantMessage"
                    },
                    "parts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Part"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "NotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "description": "Send a new command to a session for execution by the AI assistant.",
        "summary": "Send command",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "messageID": {
                    "type": "string",
                    "pattern": "^msg"
                  },
                  "agent": {
                    "type": "string"
                  },
                  "model": {
                    "type": "string"
                  },
                  "arguments": {
                    "type": "string"
                  },
                  "command": {
                    "type": "string"
                  },
                  "variant": {
                    "type": "string"
                  },
                  "parts": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^prt"
                        },
                        "type": {
                          "type": "string",
                          "enum": ["file"]
                        },
                        "mime": {
                          "type": "string"
                        },
                        "filename": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        },
                        "source": {
                          "$ref": "#/components/schemas/FilePartSource"
                        }
                      },
                      "required": ["type", "mime", "url"],
                      "additionalProperties": false
                    }
                  }
                },
                "required": ["arguments", "command"],
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.command({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/shell": {
      "post": {
        "tags": ["session"],
        "operationId": "session.shell",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Created message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "info": {
                      "$ref": "#/components/schemas/Message"
                    },
                    "parts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Part"
                      }
                    }
                  },
                  "required": ["info", "parts"],
                  "additionalProperties": false,
                  "description": "Created message"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "NotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "SessionBusyError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionBusyError"
                }
              }
            }
          }
        },
        "description": "Execute a shell command within the session context and return the AI's response.",
        "summary": "Run shell command",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "messageID": {
                    "type": "string",
                    "pattern": "^msg"
                  },
                  "agent": {
                    "type": "string"
                  },
                  "model": {
                    "type": "object",
                    "properties": {
                      "providerID": {
                        "type": "string"
                      },
                      "modelID": {
                        "type": "string"
                      }
                    },
                    "required": ["providerID", "modelID"],
                    "additionalProperties": false
                  },
                  "command": {
                    "type": "string"
                  }
                },
                "required": ["agent", "command"],
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.shell({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/revert": {
      "post": {
        "tags": ["session"],
        "operationId": "session.revert",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Updated session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "NotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "SessionBusyError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionBusyError"
                }
              }
            }
          }
        },
        "description": "Revert a specific message in a session, undoing its effects and restoring the previous state.",
        "summary": "Revert message",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "messageID": {
                    "type": "string",
                    "pattern": "^msg"
                  },
                  "partID": {
                    "type": "string",
                    "pattern": "^prt"
                  }
                },
                "required": ["messageID"],
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.revert({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/unrevert": {
      "post": {
        "tags": ["session"],
        "operationId": "session.unrevert",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Updated session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "NotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "SessionBusyError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionBusyError"
                }
              }
            }
          }
        },
        "description": "Restore all previously reverted messages in a session.",
        "summary": "Restore reverted messages",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unrevert({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/permissions/{permissionID}": {
      "post": {
        "tags": ["session"],
        "operationId": "permission.respond",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          },
          {
            "name": "permissionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^per"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Permission processed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "Permission processed successfully"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "NotFoundError | PermissionNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/NotFoundError"
                    },
                    {
                      "$ref": "#/components/schemas/PermissionNotFoundError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Approve or deny a permission request from the AI assistant.",
        "summary": "Respond to permission",
        "deprecated": true,
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "response": {
                    "type": "string",
                    "enum": ["once", "always", "reject"]
                  }
                },
                "required": ["response"],
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.respond({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/message/{messageID}/part/{partID}": {
      "delete": {
        "tags": ["session"],
        "operationId": "part.delete",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          },
          {
            "name": "messageID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^msg"
            },
            "required": true
          },
          {
            "name": "partID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^prt"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully deleted part",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "Successfully deleted part"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "NotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "description": "Delete a part from a message.",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.delete({\n  ...\n})"
          }
        ]
      },
      "patch": {
        "tags": ["session"],
        "operationId": "part.update",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          },
          {
            "name": "messageID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^msg"
            },
            "required": true
          },
          {
            "name": "partID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^prt"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully updated part",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Part"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "NotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "description": "Update a part in a message.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Part"
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.update({\n  ...\n})"
          }
        ]
      }
    },
    "/sync/start": {
      "post": {
        "tags": ["sync"],
        "operationId": "sync.start",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Workspace sync started",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "Workspace sync started"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Start sync loops for workspaces in the current project that have active sessions.",
        "summary": "Start workspace sync",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.start({\n  ...\n})"
          }
        ]
      }
    },
    "/sync/replay": {
      "post": {
        "tags": ["sync"],
        "operationId": "sync.replay",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Replayed sync events",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sessionID": {
                      "type": "string"
                    }
                  },
                  "required": ["sessionID"],
                  "additionalProperties": false,
                  "description": "Replayed sync events"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Validate and replay a complete sync event history.",
        "summary": "Replay sync events",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "directory": {
                    "type": "string"
                  },
                  "events": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^evt_"
                        },
                        "aggregateID": {
                          "type": "string"
                        },
                        "seq": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "type": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object"
                        }
                      },
                      "required": ["id", "aggregateID", "seq", "type", "data"],
                      "additionalProperties": false
                    }
                  }
                },
                "required": ["directory", "events"],
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.replay({\n  ...\n})"
          }
        ]
      }
    },
    "/sync/steal": {
      "post": {
        "tags": ["sync"],
        "operationId": "sync.steal",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Session stolen into workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sessionID": {
                      "type": "string",
                      "pattern": "^ses"
                    }
                  },
                  "required": ["sessionID"],
                  "additionalProperties": false,
                  "description": "Session stolen into workspace"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Update a session to belong to the current workspace through the sync event system.",
        "summary": "Steal session into workspace",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  }
                },
                "required": ["sessionID"],
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.steal({\n  ...\n})"
          }
        ]
      }
    },
    "/sync/history": {
      "post": {
        "tags": ["sync"],
        "operationId": "sync.history.list",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Sync events",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "^evt_"
                      },
                      "aggregate_id": {
                        "type": "string"
                      },
                      "seq": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "type": {
                        "type": "string"
                      },
                      "data": {
                        "type": "object"
                      }
                    },
                    "required": ["id", "aggregate_id", "seq", "type", "data"],
                    "additionalProperties": false
                  },
                  "description": "Sync events"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "List sync events for all aggregates. Keys are aggregate IDs the client already knows about, values are the last known sequence ID. Events with seq > value are returned for those aggregates. Aggregates not listed in the input get their full history.",
        "summary": "List sync events",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.history.list({\n  ...\n})"
          }
        ]
      }
    },
    "/tui/append-prompt": {
      "post": {
        "tags": ["tui"],
        "operationId": "tui.appendPrompt",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Prompt processed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "Prompt processed successfully"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Append prompt to the TUI.",
        "summary": "Append TUI prompt",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string"
                  }
                },
                "required": ["text"],
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.appendPrompt({\n  ...\n})"
          }
        ]
      }
    },
    "/tui/open-help": {
      "post": {
        "tags": ["tui"],
        "operationId": "tui.openHelp",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Help dialog opened successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "Help dialog opened successfully"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Open the help dialog in the TUI to display user assistance information.",
        "summary": "Open help dialog",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openHelp({\n  ...\n})"
          }
        ]
      }
    },
    "/tui/open-sessions": {
      "post": {
        "tags": ["tui"],
        "operationId": "tui.openSessions",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Session dialog opened successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "Session dialog opened successfully"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Open the session dialog.",
        "summary": "Open sessions dialog",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openSessions({\n  ...\n})"
          }
        ]
      }
    },
    "/tui/open-themes": {
      "post": {
        "tags": ["tui"],
        "operationId": "tui.openThemes",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Theme dialog opened successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "Theme dialog opened successfully"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Open the theme dialog.",
        "summary": "Open themes dialog",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openThemes({\n  ...\n})"
          }
        ]
      }
    },
    "/tui/open-models": {
      "post": {
        "tags": ["tui"],
        "operationId": "tui.openModels",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Model dialog opened successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "Model dialog opened successfully"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Open the model dialog.",
        "summary": "Open models dialog",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openModels({\n  ...\n})"
          }
        ]
      }
    },
    "/tui/submit-prompt": {
      "post": {
        "tags": ["tui"],
        "operationId": "tui.submitPrompt",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Prompt submitted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "Prompt submitted successfully"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Submit the prompt.",
        "summary": "Submit TUI prompt",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.submitPrompt({\n  ...\n})"
          }
        ]
      }
    },
    "/tui/clear-prompt": {
      "post": {
        "tags": ["tui"],
        "operationId": "tui.clearPrompt",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Prompt cleared successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "Prompt cleared successfully"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Clear the prompt.",
        "summary": "Clear TUI prompt",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.clearPrompt({\n  ...\n})"
          }
        ]
      }
    },
    "/tui/execute-command": {
      "post": {
        "tags": ["tui"],
        "operationId": "tui.executeCommand",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Command executed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "Command executed successfully"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Execute a TUI command.",
        "summary": "Execute TUI command",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "command": {
                    "type": "string"
                  }
                },
                "required": ["command"],
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.executeCommand({\n  ...\n})"
          }
        ]
      }
    },
    "/tui/show-toast": {
      "post": {
        "tags": ["tui"],
        "operationId": "tui.showToast",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Toast notification shown successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "Toast notification shown successfully"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Show a toast notification in the TUI.",
        "summary": "Show TUI toast",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string"
                  },
                  "variant": {
                    "type": "string",
                    "enum": ["info", "success", "warning", "error"]
                  },
                  "duration": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  }
                },
                "required": ["message", "variant"],
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.showToast({\n  ...\n})"
          }
        ]
      }
    },
    "/tui/publish": {
      "post": {
        "tags": ["tui"],
        "operationId": "tui.publish",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Event published successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "Event published successfully"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Publish a TUI event.",
        "summary": "Publish TUI event",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/EventTuiPromptAppend"
                  },
                  {
                    "$ref": "#/components/schemas/EventTuiCommandExecute"
                  },
                  {
                    "$ref": "#/components/schemas/EventTuiToastShow"
                  },
                  {
                    "$ref": "#/components/schemas/EventTuiSessionSelect"
                  }
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.publish({\n  ...\n})"
          }
        ]
      }
    },
    "/tui/select-session": {
      "post": {
        "tags": ["tui"],
        "operationId": "tui.selectSession",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Session selected successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "Session selected successfully"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "NotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "description": "Navigate the TUI to display the specified session.",
        "summary": "Select session",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses",
                    "description": "Session ID to navigate to"
                  }
                },
                "required": ["sessionID"],
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.selectSession({\n  ...\n})"
          }
        ]
      }
    },
    "/tui/control/next": {
      "get": {
        "tags": ["tui"],
        "operationId": "tui.control.next",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Next TUI request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "path": {
                      "type": "string"
                    },
                    "body": {}
                  },
                  "required": ["path", "body"],
                  "additionalProperties": false,
                  "description": "Next TUI request"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Retrieve the next TUI request from the queue for processing.",
        "summary": "Get next TUI request",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.next({\n  ...\n})"
          }
        ]
      }
    },
    "/tui/control/response": {
      "post": {
        "tags": ["tui"],
        "operationId": "tui.control.response",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Response submitted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "Response submitted successfully"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Submit a response to the TUI request queue to complete a pending request.",
        "summary": "Submit TUI response",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.response({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/workspace/adapter": {
      "get": {
        "tags": ["workspace"],
        "operationId": "experimental.workspace.adapter.list",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Workspace adapters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      }
                    },
                    "required": ["type", "name", "description"],
                    "additionalProperties": false
                  },
                  "description": "Workspace adapters"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "List all available workspace adapters for the current project.",
        "summary": "List workspace adapters",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.adapter.list({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/workspace": {
      "get": {
        "tags": ["workspace"],
        "operationId": "experimental.workspace.list",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Workspaces",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Workspace"
                  },
                  "description": "Workspaces"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "List all workspaces.",
        "summary": "List workspaces",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.list({\n  ...\n})"
          }
        ]
      },
      "post": {
        "tags": ["workspace"],
        "operationId": "experimental.workspace.create",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Workspace created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workspace"
                }
              }
            }
          },
          "400": {
            "description": "WorkspaceCreateError | BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/WorkspaceCreateError"
                    },
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Create a workspace for the current project.",
        "summary": "Create workspace",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^wrk"
                  },
                  "type": {
                    "type": "string"
                  },
                  "branch": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "extra": {
                    "anyOf": [
                      {},
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": ["type"],
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.create({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/workspace/sync-list": {
      "post": {
        "tags": ["workspace"],
        "operationId": "experimental.workspace.syncList",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "204": {
            "description": "Workspace list synced"
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Register missing workspaces returned by workspace adapters.",
        "summary": "Sync workspace list",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.syncList({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/workspace/status": {
      "get": {
        "tags": ["workspace"],
        "operationId": "experimental.workspace.status",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Workspace status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WorkspaceEventConnectionStatus"
                  },
                  "description": "Workspace status"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "description": "Get connection status for workspaces in the current project.",
        "summary": "Workspace status",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.status({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/workspace/{id}": {
      "delete": {
        "tags": ["workspace"],
        "operationId": "experimental.workspace.remove",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^wrk"
            },
            "required": true
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Workspace removed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workspace"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Remove an existing workspace.",
        "summary": "Remove workspace",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.remove({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/workspace/warp": {
      "post": {
        "tags": ["workspace"],
        "operationId": "experimental.workspace.warp",
        "parameters": [
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "204": {
            "description": "Session warped"
          },
          "400": {
            "description": "WorkspaceWarpError | VcsApplyError | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/WorkspaceWarpError"
                    },
                    {
                      "$ref": "#/components/schemas/VcsApplyError"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "NotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "description": "Move a session's sync history into the target workspace, or detach it to the local project.",
        "summary": "Warp session into workspace",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^wrk"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "copyChanges": {
                    "type": "boolean"
                  }
                },
                "required": ["id", "sessionID"],
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.warp({\n  ...\n})"
          }
        ]
      }
    },
    "/api/health": {
      "get": {
        "tags": ["opencode HttpApi"],
        "operationId": "v2.health.get",
        "parameters": [],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "healthy": {
                      "type": "boolean",
                      "enum": [true]
                    }
                  },
                  "required": ["healthy"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          }
        },
        "description": "Check whether the API server is ready to accept requests.",
        "summary": "Check server health",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.health.get({\n  ...\n})"
          }
        ]
      }
    },
    "/api/location": {
      "get": {
        "tags": ["opencode HttpApi"],
        "operationId": "v2.location.get",
        "parameters": [
          {
            "name": "location",
            "in": "query",
            "schema": {
              "type": "object",
              "properties": {
                "directory": {
                  "type": "string"
                },
                "workspace": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "required": false,
            "style": "deepObject",
            "explode": true
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Location.Info",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationInfo"
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          }
        },
        "description": "Resolve the requested location or the server default location.",
        "summary": "Get location",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.location.get({\n  ...\n})"
          }
        ]
      }
    },
    "/api/agent": {
      "get": {
        "tags": ["opencode HttpApi"],
        "operationId": "v2.agent.list",
        "parameters": [
          {
            "name": "location",
            "in": "query",
            "schema": {
              "type": "object",
              "properties": {
                "directory": {
                  "type": "string"
                },
                "workspace": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "required": false,
            "style": "deepObject",
            "explode": true
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "location": {
                      "$ref": "#/components/schemas/LocationInfo"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AgentV2Info"
                      }
                    }
                  },
                  "required": ["location", "data"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          }
        },
        "description": "Retrieve currently registered agents.",
        "summary": "List agents",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.agent.list({\n  ...\n})"
          }
        ]
      }
    },
    "/api/session": {
      "get": {
        "tags": ["sessions"],
        "operationId": "v2.session.list",
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^wrk"
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "required": false
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "required": false
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "directory",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "project",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "subpath",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "Opaque pagination cursor returned as cursor.previous or cursor.next in the previous response."
            },
            "required": false
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "SessionsResponse",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionsResponse"
                }
              }
            }
          },
          "400": {
            "description": "InvalidCursorError | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/InvalidCursorError"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          }
        },
        "description": "Retrieve sessions in the requested order. Items keep that order across pages; use cursor.next or cursor.previous to move through the ordered list.",
        "summary": "List sessions",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.list({\n  ...\n})"
          }
        ]
      },
      "post": {
        "tags": ["sessions"],
        "operationId": "v2.session.create",
        "parameters": [],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SessionV2Info"
                    }
                  },
                  "required": ["data"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          }
        },
        "description": "Create a session at the requested location.",
        "summary": "Create session",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "agent": {
                    "type": "string"
                  },
                  "model": {
                    "$ref": "#/components/schemas/ModelRef"
                  },
                  "location": {
                    "$ref": "#/components/schemas/LocationRef"
                  }
                },
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.create({\n  ...\n})"
          }
        ]
      }
    },
    "/api/session/active": {
      "get": {
        "tags": ["sessions"],
        "operationId": "v2.session.active",
        "parameters": [],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "patternProperties": {
                        "^ses": {
                          "$ref": "#/components/schemas/SessionActive"
                        }
                      }
                    }
                  },
                  "required": ["data"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          }
        },
        "description": "Retrieve foreground Session drains currently owned by this OpenCode process. Sessions absent from the result are inactive.",
        "summary": "List active sessions",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.active({\n  ...\n})"
          }
        ]
      }
    },
    "/api/session/{sessionID}": {
      "get": {
        "tags": ["sessions"],
        "operationId": "v2.session.get",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SessionV2Info"
                    }
                  },
                  "required": ["data"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "404": {
            "description": "SessionNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    },
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Retrieve a session by ID.",
        "summary": "Get session",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.get({\n  ...\n})"
          }
        ]
      }
    },
    "/api/session/{sessionID}/agent": {
      "post": {
        "tags": ["sessions"],
        "operationId": "v2.session.switchAgent",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          }
        ],
        "security": [],
        "responses": {
          "204": {
            "description": "<No Content>"
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "404": {
            "description": "SessionNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    },
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Switch the agent used by subsequent provider turns.",
        "summary": "Switch session agent",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "agent": {
                    "type": "string"
                  }
                },
                "required": ["agent"],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.switchAgent({\n  ...\n})"
          }
        ]
      }
    },
    "/api/session/{sessionID}/model": {
      "post": {
        "tags": ["sessions"],
        "operationId": "v2.session.switchModel",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          }
        ],
        "security": [],
        "responses": {
          "204": {
            "description": "<No Content>"
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "404": {
            "description": "SessionNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    },
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Switch the model used by subsequent provider turns.",
        "summary": "Switch session model",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "$ref": "#/components/schemas/ModelRef"
                  }
                },
                "required": ["model"],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.switchModel({\n  ...\n})"
          }
        ]
      }
    },
    "/api/session/{sessionID}/prompt": {
      "post": {
        "tags": ["sessions"],
        "operationId": "v2.session.prompt",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SessionInputAdmitted"
                    }
                  },
                  "required": ["data"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "404": {
            "description": "SessionNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    },
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    }
                  ]
                }
              }
            }
          },
          "409": {
            "description": "ConflictError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          }
        },
        "description": "Durably admit one session input and schedule agent-loop execution unless resume is false.",
        "summary": "Send message",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^msg_"
                  },
                  "prompt": {
                    "$ref": "#/components/schemas/PromptInput"
                  },
                  "delivery": {
                    "type": "string",
                    "enum": ["steer", "queue"]
                  },
                  "resume": {
                    "type": "boolean"
                  }
                },
                "required": ["prompt"],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.prompt({\n  ...\n})"
          }
        ]
      }
    },
    "/api/session/{sessionID}/compact": {
      "post": {
        "tags": ["sessions"],
        "operationId": "v2.session.compact",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          }
        ],
        "security": [],
        "responses": {
          "204": {
            "description": "<No Content>"
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "404": {
            "description": "SessionNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    },
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "ServiceUnavailableError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceUnavailableError"
                }
              }
            }
          }
        },
        "description": "Compact a session conversation.",
        "summary": "Compact session",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.compact({\n  ...\n})"
          }
        ]
      }
    },
    "/api/session/{sessionID}/wait": {
      "post": {
        "tags": ["sessions"],
        "operationId": "v2.session.wait",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          }
        ],
        "security": [],
        "responses": {
          "204": {
            "description": "<No Content>"
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "404": {
            "description": "SessionNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    },
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "ServiceUnavailableError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceUnavailableError"
                }
              }
            }
          }
        },
        "description": "Wait for a session agent loop to become idle.",
        "summary": "Wait for session",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.wait({\n  ...\n})"
          }
        ]
      }
    },
    "/api/session/{sessionID}/revert/stage": {
      "post": {
        "tags": ["sessions"],
        "operationId": "v2.session.revert.stage",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RevertState"
                    }
                  },
                  "required": ["data"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "404": {
            "description": "MessageNotFoundError | SessionNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/MessageNotFoundError"
                    },
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    },
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "UnknownError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnknownError1"
                }
              }
            }
          }
        },
        "description": "Stage or move a reversible session boundary and optionally apply its file changes.",
        "summary": "Stage session revert",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "messageID": {
                    "type": "string",
                    "pattern": "^msg_"
                  },
                  "files": {
                    "type": "boolean"
                  }
                },
                "required": ["messageID"],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.revert.stage({\n  ...\n})"
          }
        ]
      }
    },
    "/api/session/{sessionID}/revert/clear": {
      "post": {
        "tags": ["sessions"],
        "operationId": "v2.session.revert.clear",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          }
        ],
        "security": [],
        "responses": {
          "204": {
            "description": "<No Content>"
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "404": {
            "description": "SessionNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    },
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "UnknownError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnknownError1"
                }
              }
            }
          }
        },
        "summary": "Clear staged revert",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.revert.clear({\n  ...\n})"
          }
        ]
      }
    },
    "/api/session/{sessionID}/revert/commit": {
      "post": {
        "tags": ["sessions"],
        "operationId": "v2.session.revert.commit",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          }
        ],
        "security": [],
        "responses": {
          "204": {
            "description": "<No Content>"
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "404": {
            "description": "SessionNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    },
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    }
                  ]
                }
              }
            }
          }
        },
        "summary": "Commit staged revert",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.revert.commit({\n  ...\n})"
          }
        ]
      }
    },
    "/api/session/{sessionID}/context": {
      "get": {
        "tags": ["sessions"],
        "operationId": "v2.session.context",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SessionMessage"
                      }
                    }
                  },
                  "required": ["data"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "404": {
            "description": "SessionNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    },
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "UnknownError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnknownError1"
                }
              }
            }
          }
        },
        "description": "Retrieve the active context messages for a session (all messages after the last compaction).",
        "summary": "Get session context",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.context({\n  ...\n})"
          }
        ]
      }
    },
    "/api/session/{sessionID}/history": {
      "get": {
        "tags": ["sessions"],
        "operationId": "v2.session.history",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "after",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "SessionHistory",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionHistory"
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "404": {
            "description": "SessionNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    },
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Read one finite page of public durable Session events after an exclusive aggregate sequence. Newly committed events may appear on later pages.",
        "summary": "Get session history",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.history({\n  ...\n})"
          }
        ]
      }
    },
    "/api/session/{sessionID}/event": {
      "get": {
        "tags": ["sessions"],
        "operationId": "v2.session.events",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          },
          {
            "name": "after",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "event": {
                      "type": "string"
                    },
                    "data": {
                      "$ref": "#/components/schemas/SessionDurableEventStream"
                    }
                  },
                  "required": ["id", "event", "data"],
                  "additionalProperties": false
                },
                "x-effect-stream": {
                  "encoding": "sse",
                  "causeSchema": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "_tag": {
                              "type": "string",
                              "enum": ["Fail"]
                            },
                            "error": {
                              "not": {}
                            }
                          },
                          "required": ["_tag", "error"],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "_tag": {
                              "type": "string",
                              "enum": ["Die"]
                            },
                            "defect": {}
                          },
                          "required": ["_tag", "defect"],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "_tag": {
                              "type": "string",
                              "enum": ["Interrupt"]
                            },
                            "fiberId": {
                              "anyOf": [
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": ["_tag", "fiberId"],
                          "additionalProperties": false
                        }
                      ]
                    }
                  },
                  "errorSchema": {
                    "not": {}
                  },
                  "failureEvent": "effect/httpapi/stream/failure"
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "404": {
            "description": "SessionNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    },
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Replay durable events after an aggregate sequence, then continue with new durable events.",
        "summary": "Subscribe to session events",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.events({\n  ...\n})"
          }
        ]
      }
    },
    "/api/session/{sessionID}/interrupt": {
      "post": {
        "tags": ["sessions"],
        "operationId": "v2.session.interrupt",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          }
        ],
        "security": [],
        "responses": {
          "204": {
            "description": "<No Content>"
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "404": {
            "description": "SessionNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    },
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Interrupt active execution owned by this OpenCode process. Idle interruption is a no-op.",
        "summary": "Interrupt session execution",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.interrupt({\n  ...\n})"
          }
        ]
      }
    },
    "/api/session/{sessionID}/message/{messageID}": {
      "get": {
        "tags": ["sessions"],
        "operationId": "v2.session.message",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          },
          {
            "name": "messageID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^msg_"
            },
            "required": true
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SessionMessage"
                    }
                  },
                  "required": ["data"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "404": {
            "description": "SessionNotFoundError | MessageNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/MessageNotFoundError"
                    },
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    },
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Retrieve one projected message owned by the Session.",
        "summary": "Get session message",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.message({\n  ...\n})"
          }
        ]
      }
    },
    "/api/session/{sessionID}/message": {
      "get": {
        "tags": ["messages"],
        "operationId": "v2.session.messages",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "required": false
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": ["asc", "desc"]
            },
            "required": false
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "Opaque pagination cursor returned as cursor.previous or cursor.next in the previous response. Do not combine with order."
            },
            "required": false
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "SessionMessagesResponse",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionMessagesResponse"
                }
              }
            }
          },
          "400": {
            "description": "InvalidCursorError | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/InvalidCursorError"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "404": {
            "description": "SessionNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    },
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "UnknownError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnknownError1"
                }
              }
            }
          }
        },
        "description": "Retrieve projected messages for a session. Items keep the requested order across pages; use cursor.next or cursor.previous to move through the ordered timeline.",
        "summary": "Get session messages",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.messages({\n  ...\n})"
          }
        ]
      }
    },
    "/api/model": {
      "get": {
        "tags": ["models"],
        "operationId": "v2.model.list",
        "parameters": [
          {
            "name": "location",
            "in": "query",
            "schema": {
              "type": "object",
              "properties": {
                "directory": {
                  "type": "string"
                },
                "workspace": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "required": false,
            "style": "deepObject",
            "explode": true
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "location": {
                      "$ref": "#/components/schemas/LocationInfo"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ModelV2Info"
                      }
                    }
                  },
                  "required": ["location", "data"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "503": {
            "description": "ServiceUnavailableError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceUnavailableError"
                }
              }
            }
          }
        },
        "description": "Retrieve available models ordered by release date.",
        "summary": "List models",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.model.list({\n  ...\n})"
          }
        ]
      }
    },
    "/api/provider": {
      "get": {
        "tags": ["providers"],
        "operationId": "v2.provider.list",
        "parameters": [
          {
            "name": "location",
            "in": "query",
            "schema": {
              "type": "object",
              "properties": {
                "directory": {
                  "type": "string"
                },
                "workspace": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "required": false,
            "style": "deepObject",
            "explode": true
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "location": {
                      "$ref": "#/components/schemas/LocationInfo"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ProviderV2Info"
                      }
                    }
                  },
                  "required": ["location", "data"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "503": {
            "description": "ServiceUnavailableError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceUnavailableError"
                }
              }
            }
          }
        },
        "description": "Retrieve active AI providers so clients can show provider availability and configuration.",
        "summary": "List providers",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.provider.list({\n  ...\n})"
          }
        ]
      }
    },
    "/api/provider/{providerID}": {
      "get": {
        "tags": ["providers"],
        "operationId": "v2.provider.get",
        "parameters": [
          {
            "name": "providerID",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "location",
            "in": "query",
            "schema": {
              "type": "object",
              "properties": {
                "directory": {
                  "type": "string"
                },
                "workspace": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "required": false,
            "style": "deepObject",
            "explode": true
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "location": {
                      "$ref": "#/components/schemas/LocationInfo"
                    },
                    "data": {
                      "$ref": "#/components/schemas/ProviderV2Info"
                    }
                  },
                  "required": ["location", "data"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "404": {
            "description": "ProviderNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderNotFoundError"
                }
              }
            }
          },
          "503": {
            "description": "ServiceUnavailableError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceUnavailableError"
                }
              }
            }
          }
        },
        "description": "Retrieve a single AI provider so clients can inspect its availability and endpoint settings.",
        "summary": "Get provider",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.provider.get({\n  ...\n})"
          }
        ]
      }
    },
    "/api/integration": {
      "get": {
        "tags": ["integrations"],
        "operationId": "v2.integration.list",
        "parameters": [
          {
            "name": "location",
            "in": "query",
            "schema": {
              "type": "object",
              "properties": {
                "directory": {
                  "type": "string"
                },
                "workspace": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "required": false,
            "style": "deepObject",
            "explode": true
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "location": {
                      "$ref": "#/components/schemas/LocationInfo"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/IntegrationInfo"
                      }
                    }
                  },
                  "required": ["location", "data"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          }
        },
        "description": "Retrieve available integrations and their authentication methods.",
        "summary": "List integrations",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.integration.list({\n  ...\n})"
          }
        ]
      }
    },
    "/api/integration/{integrationID}": {
      "get": {
        "tags": ["integrations"],
        "operationId": "v2.integration.get",
        "parameters": [
          {
            "name": "integrationID",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "location",
            "in": "query",
            "schema": {
              "type": "object",
              "properties": {
                "directory": {
                  "type": "string"
                },
                "workspace": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "required": false,
            "style": "deepObject",
            "explode": true
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "location": {
                      "$ref": "#/components/schemas/LocationInfo"
                    },
                    "data": {
                      "$ref": "#/components/schemas/IntegrationInfo"
                    }
                  },
                  "required": ["location", "data"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          }
        },
        "description": "Retrieve one integration and its authentication methods.",
        "summary": "Get integration",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.integration.get({\n  ...\n})"
          }
        ]
      }
    },
    "/api/integration/{integrationID}/connect/key": {
      "post": {
        "tags": ["integrations"],
        "operationId": "v2.integration.connect.key",
        "parameters": [
          {
            "name": "integrationID",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "location",
            "in": "query",
            "schema": {
              "type": "object",
              "properties": {
                "directory": {
                  "type": "string"
                },
                "workspace": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "required": false,
            "style": "deepObject",
            "explode": true
          }
        ],
        "security": [],
        "responses": {
          "204": {
            "description": "<No Content>"
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          }
        },
        "description": "Run a key authentication method and store the resulting credential.",
        "summary": "Connect with key",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string"
                  },
                  "label": {
                    "type": "string"
                  }
                },
                "required": ["key"],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.integration.connect.key({\n  ...\n})"
          }
        ]
      }
    },
    "/api/integration/{integrationID}/connect/oauth": {
      "post": {
        "tags": ["integrations"],
        "operationId": "v2.integration.connect.oauth",
        "parameters": [
          {
            "name": "integrationID",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "location",
            "in": "query",
            "schema": {
              "type": "object",
              "properties": {
                "directory": {
                  "type": "string"
                },
                "workspace": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "required": false,
            "style": "deepObject",
            "explode": true
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "location": {
                      "$ref": "#/components/schemas/LocationInfo"
                    },
                    "data": {
                      "$ref": "#/components/schemas/IntegrationAttempt"
                    }
                  },
                  "required": ["location", "data"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          }
        },
        "description": "Start an OAuth attempt and return the authorization details.",
        "summary": "Begin OAuth connection",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "methodID": {
                    "type": "string"
                  },
                  "inputs": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "label": {
                    "type": "string"
                  }
                },
                "required": ["methodID", "inputs"],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.integration.connect.oauth({\n  ...\n})"
          }
        ]
      }
    },
    "/api/integration/attempt/{attemptID}": {
      "get": {
        "tags": ["integrations"],
        "operationId": "v2.integration.attempt.status",
        "parameters": [
          {
            "name": "attemptID",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "location",
            "in": "query",
            "schema": {
              "type": "object",
              "properties": {
                "directory": {
                  "type": "string"
                },
                "workspace": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "required": false,
            "style": "deepObject",
            "explode": true
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "location": {
                      "$ref": "#/components/schemas/LocationInfo"
                    },
                    "data": {
                      "$ref": "#/components/schemas/IntegrationAttemptStatus"
                    }
                  },
                  "required": ["location", "data"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          }
        },
        "description": "Poll the current status of an OAuth attempt.",
        "summary": "Get OAuth attempt status",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.integration.attempt.status({\n  ...\n})"
          }
        ]
      },
      "delete": {
        "tags": ["integrations"],
        "operationId": "v2.integration.attempt.cancel",
        "parameters": [
          {
            "name": "attemptID",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "location",
            "in": "query",
            "schema": {
              "type": "object",
              "properties": {
                "directory": {
                  "type": "string"
                },
                "workspace": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "required": false,
            "style": "deepObject",
            "explode": true
          }
        ],
        "security": [],
        "responses": {
          "204": {
            "description": "<No Content>"
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          }
        },
        "description": "Cancel an OAuth attempt and release its resources.",
        "summary": "Cancel OAuth connection",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.integration.attempt.cancel({\n  ...\n})"
          }
        ]
      }
    },
    "/api/integration/attempt/{attemptID}/complete": {
      "post": {
        "tags": ["integrations"],
        "operationId": "v2.integration.attempt.complete",
        "parameters": [
          {
            "name": "attemptID",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "location",
            "in": "query",
            "schema": {
              "type": "object",
              "properties": {
                "directory": {
                  "type": "string"
                },
                "workspace": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "required": false,
            "style": "deepObject",
            "explode": true
          }
        ],
        "security": [],
        "responses": {
          "204": {
            "description": "<No Content>"
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          }
        },
        "description": "Complete a code-based OAuth attempt and store the resulting credential.",
        "summary": "Complete OAuth connection",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.integration.attempt.complete({\n  ...\n})"
          }
        ]
      }
    },
    "/api/credential/{credentialID}": {
      "patch": {
        "tags": ["opencode HttpApi"],
        "operationId": "v2.credential.update",
        "parameters": [
          {
            "name": "credentialID",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "location",
            "in": "query",
            "schema": {
              "type": "object",
              "properties": {
                "directory": {
                  "type": "string"
                },
                "workspace": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "required": false,
            "style": "deepObject",
            "explode": true
          }
        ],
        "security": [],
        "responses": {
          "204": {
            "description": "<No Content>"
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          }
        },
        "description": "Update a stored credential label.",
        "summary": "Update credential",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  }
                },
                "required": ["label"],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.credential.update({\n  ...\n})"
          }
        ]
      },
      "delete": {
        "tags": ["opencode HttpApi"],
        "operationId": "v2.credential.remove",
        "parameters": [
          {
            "name": "credentialID",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "location",
            "in": "query",
            "schema": {
              "type": "object",
              "properties": {
                "directory": {
                  "type": "string"
                },
                "workspace": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "required": false,
            "style": "deepObject",
            "explode": true
          }
        ],
        "security": [],
        "responses": {
          "204": {
            "description": "<No Content>"
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          }
        },
        "description": "Remove a stored integration credential.",
        "summary": "Remove credential",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.credential.remove({\n  ...\n})"
          }
        ]
      }
    },
    "/api/permission/request": {
      "get": {
        "tags": ["permissions"],
        "operationId": "v2.permission.request.list",
        "parameters": [
          {
            "name": "location",
            "in": "query",
            "schema": {
              "type": "object",
              "properties": {
                "directory": {
                  "type": "string"
                },
                "workspace": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "required": false,
            "style": "deepObject",
            "explode": true
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "location": {
                      "$ref": "#/components/schemas/LocationInfo"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PermissionV2Request"
                      }
                    }
                  },
                  "required": ["location", "data"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          }
        },
        "description": "Retrieve pending permission requests for a location.",
        "summary": "List pending permission requests",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.permission.request.list({\n  ...\n})"
          }
        ]
      }
    },
    "/api/permission/saved": {
      "get": {
        "tags": ["permissions"],
        "operationId": "v2.permission.saved.list",
        "parameters": [
          {
            "name": "projectID",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PermissionSavedInfo"
                      }
                    }
                  },
                  "required": ["data"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          }
        },
        "description": "Retrieve saved permissions, optionally filtered by project.",
        "summary": "List saved permissions",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.permission.saved.list({\n  ...\n})"
          }
        ]
      }
    },
    "/api/permission/saved/{id}": {
      "delete": {
        "tags": ["permissions"],
        "operationId": "v2.permission.saved.remove",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "security": [],
        "responses": {
          "204": {
            "description": "<No Content>"
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          }
        },
        "description": "Remove a saved permission by ID.",
        "summary": "Remove saved permission",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.permission.saved.remove({\n  ...\n})"
          }
        ]
      }
    },
    "/api/session/{sessionID}/permission": {
      "post": {
        "tags": ["permissions"],
        "operationId": "v2.session.permission.create",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^per"
                        },
                        "effect": {
                          "$ref": "#/components/schemas/PermissionV2Effect"
                        }
                      },
                      "required": ["id", "effect"],
                      "additionalProperties": false
                    }
                  },
                  "required": ["data"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "404": {
            "description": "SessionNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    },
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Evaluate and, when approval is required, create a permission request for a session.",
        "summary": "Create permission request",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^per"
                  },
                  "action": {
                    "type": "string"
                  },
                  "resources": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "save": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "metadata": {
                    "type": "object"
                  },
                  "source": {
                    "$ref": "#/components/schemas/PermissionV2Source"
                  },
                  "agent": {
                    "type": "string"
                  }
                },
                "required": ["action", "resources"],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.permission.create({\n  ...\n})"
          }
        ]
      },
      "get": {
        "tags": ["permissions"],
        "operationId": "v2.session.permission.list",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PermissionV2Request"
                      }
                    }
                  },
                  "required": ["data"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "404": {
            "description": "SessionNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    },
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Retrieve pending permission requests owned by a session.",
        "summary": "List session permission requests",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.permission.list({\n  ...\n})"
          }
        ]
      }
    },
    "/api/session/{sessionID}/permission/{requestID}": {
      "get": {
        "tags": ["permissions"],
        "operationId": "v2.session.permission.get",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          },
          {
            "name": "requestID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^per"
            },
            "required": true
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PermissionV2Request"
                    }
                  },
                  "required": ["data"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "404": {
            "description": "SessionNotFoundError | PermissionNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/PermissionNotFoundError"
                    },
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    },
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Retrieve a pending permission request owned by a session.",
        "summary": "Get permission request",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.permission.get({\n  ...\n})"
          }
        ]
      }
    },
    "/api/session/{sessionID}/permission/{requestID}/reply": {
      "post": {
        "tags": ["permissions"],
        "operationId": "v2.session.permission.reply",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          },
          {
            "name": "requestID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^per"
            },
            "required": true
          }
        ],
        "security": [],
        "responses": {
          "204": {
            "description": "<No Content>"
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "404": {
            "description": "SessionNotFoundError | PermissionNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/PermissionNotFoundError"
                    },
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    },
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Respond to a pending permission request owned by a session.",
        "summary": "Reply to pending permission request",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reply": {
                    "$ref": "#/components/schemas/PermissionV2Reply"
                  },
                  "message": {
                    "type": "string"
                  }
                },
                "required": ["reply"],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.permission.reply({\n  ...\n})"
          }
        ]
      }
    },
    "/api/fs/read/*": {
      "get": {
        "tags": ["filesystem"],
        "operationId": "v2.fs.read",
        "parameters": [
          {
            "name": "location",
            "in": "query",
            "schema": {
              "type": "object",
              "properties": {
                "directory": {
                  "type": "string"
                },
                "workspace": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "required": false,
            "style": "deepObject",
            "explode": true
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          }
        },
        "description": "Serve one file relative to the requested location.",
        "summary": "Read file",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.fs.read({\n  ...\n})"
          }
        ]
      }
    },
    "/api/fs/list": {
      "get": {
        "tags": ["filesystem"],
        "operationId": "v2.fs.list",
        "parameters": [
          {
            "name": "location",
            "in": "query",
            "schema": {
              "type": "object",
              "properties": {
                "directory": {
                  "type": "string"
                },
                "workspace": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "required": false,
            "style": "deepObject",
            "explode": true
          },
          {
            "name": "path",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "location": {
                      "$ref": "#/components/schemas/LocationInfo"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/FileSystemEntry"
                      }
                    }
                  },
                  "required": ["location", "data"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          }
        },
        "description": "List direct children of one directory relative to the requested location.",
        "summary": "List directory",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.fs.list({\n  ...\n})"
          }
        ]
      }
    },
    "/api/fs/find": {
      "get": {
        "tags": ["filesystem"],
        "operationId": "v2.fs.find",
        "parameters": [
          {
            "name": "location",
            "in": "query",
            "schema": {
              "type": "object",
              "properties": {
                "directory": {
                  "type": "string"
                },
                "workspace": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "required": false,
            "style": "deepObject",
            "explode": true
          },
          {
            "name": "query",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": ["file", "directory"]
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "location": {
                      "$ref": "#/components/schemas/LocationInfo"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/FileSystemEntry"
                      }
                    }
                  },
                  "required": ["location", "data"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          }
        },
        "description": "Find recursively ranked filesystem entries relative to the requested location.",
        "summary": "Find files",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.fs.find({\n  ...\n})"
          }
        ]
      }
    },
    "/api/command": {
      "get": {
        "tags": ["commands"],
        "operationId": "v2.command.list",
        "parameters": [
          {
            "name": "location",
            "in": "query",
            "schema": {
              "type": "object",
              "properties": {
                "directory": {
                  "type": "string"
                },
                "workspace": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "required": false,
            "style": "deepObject",
            "explode": true
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "location": {
                      "$ref": "#/components/schemas/LocationInfo"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CommandV2Info"
                      }
                    }
                  },
                  "required": ["location", "data"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          }
        },
        "description": "Retrieve currently registered commands.",
        "summary": "List commands",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.command.list({\n  ...\n})"
          }
        ]
      }
    },
    "/api/skill": {
      "get": {
        "tags": ["skills"],
        "operationId": "v2.skill.list",
        "parameters": [
          {
            "name": "location",
            "in": "query",
            "schema": {
              "type": "object",
              "properties": {
                "directory": {
                  "type": "string"
                },
                "workspace": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "required": false,
            "style": "deepObject",
            "explode": true
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "location": {
                      "$ref": "#/components/schemas/LocationInfo"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SkillV2Info"
                      }
                    }
                  },
                  "required": ["location", "data"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          }
        },
        "description": "Retrieve currently registered skills.",
        "summary": "List skills",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.skill.list({\n  ...\n})"
          }
        ]
      }
    },
    "/api/event": {
      "get": {
        "tags": ["events"],
        "operationId": "v2.event.subscribe",
        "parameters": [],
        "security": [],
        "responses": {
          "200": {
            "description": "Event stream",
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/V2Event"
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          }
        },
        "description": "Subscribe to native event payloads for the server.",
        "summary": "Subscribe to events",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.event.subscribe({\n  ...\n})"
          }
        ]
      }
    },
    "/api/pty": {
      "get": {
        "tags": ["pty"],
        "operationId": "v2.pty.list",
        "parameters": [
          {
            "name": "location",
            "in": "query",
            "schema": {
              "type": "object",
              "properties": {
                "directory": {
                  "type": "string"
                },
                "workspace": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "required": false,
            "style": "deepObject",
            "explode": true
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "location": {
                      "$ref": "#/components/schemas/LocationInfo"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Pty"
                      }
                    }
                  },
                  "required": ["location", "data"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          }
        },
        "description": "List PTY sessions for a location, including exited sessions retained until removal.",
        "summary": "List PTY sessions",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.pty.list({\n  ...\n})"
          }
        ]
      },
      "post": {
        "tags": ["pty"],
        "operationId": "v2.pty.create",
        "parameters": [
          {
            "name": "location",
            "in": "query",
            "schema": {
              "type": "object",
              "properties": {
                "directory": {
                  "type": "string"
                },
                "workspace": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "required": false,
            "style": "deepObject",
            "explode": true
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "location": {
                      "$ref": "#/components/schemas/LocationInfo"
                    },
                    "data": {
                      "$ref": "#/components/schemas/Pty"
                    }
                  },
                  "required": ["location", "data"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          }
        },
        "description": "Create a pseudo-terminal session for a location.",
        "summary": "Create PTY session",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "command": {
                    "type": "string"
                  },
                  "args": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "cwd": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  },
                  "env": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.pty.create({\n  ...\n})"
          }
        ]
      }
    },
    "/api/pty/{ptyID}": {
      "get": {
        "tags": ["pty"],
        "operationId": "v2.pty.get",
        "parameters": [
          {
            "name": "ptyID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^pty"
            },
            "required": true
          },
          {
            "name": "location",
            "in": "query",
            "schema": {
              "type": "object",
              "properties": {
                "directory": {
                  "type": "string"
                },
                "workspace": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "required": false,
            "style": "deepObject",
            "explode": true
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "location": {
                      "$ref": "#/components/schemas/LocationInfo"
                    },
                    "data": {
                      "$ref": "#/components/schemas/Pty"
                    }
                  },
                  "required": ["location", "data"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "404": {
            "description": "PtyNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PtyNotFoundError"
                }
              }
            }
          }
        },
        "description": "Get one PTY session, including its exit code once exited.",
        "summary": "Get PTY session",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.pty.get({\n  ...\n})"
          }
        ]
      },
      "put": {
        "tags": ["pty"],
        "operationId": "v2.pty.update",
        "parameters": [
          {
            "name": "ptyID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^pty"
            },
            "required": true
          },
          {
            "name": "location",
            "in": "query",
            "schema": {
              "type": "object",
              "properties": {
                "directory": {
                  "type": "string"
                },
                "workspace": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "required": false,
            "style": "deepObject",
            "explode": true
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "location": {
                      "$ref": "#/components/schemas/LocationInfo"
                    },
                    "data": {
                      "$ref": "#/components/schemas/Pty"
                    }
                  },
                  "required": ["location", "data"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "404": {
            "description": "PtyNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PtyNotFoundError"
                }
              }
            }
          }
        },
        "description": "Update the title or viewport size of one PTY session.",
        "summary": "Update PTY session",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string"
                  },
                  "size": {
                    "type": "object",
                    "properties": {
                      "rows": {
                        "type": "integer",
                        "exclusiveMinimum": 0
                      },
                      "cols": {
                        "type": "integer",
                        "exclusiveMinimum": 0
                      }
                    },
                    "required": ["rows", "cols"],
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.pty.update({\n  ...\n})"
          }
        ]
      },
      "delete": {
        "tags": ["pty"],
        "operationId": "v2.pty.remove",
        "parameters": [
          {
            "name": "ptyID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^pty"
            },
            "required": true
          },
          {
            "name": "location",
            "in": "query",
            "schema": {
              "type": "object",
              "properties": {
                "directory": {
                  "type": "string"
                },
                "workspace": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "required": false,
            "style": "deepObject",
            "explode": true
          }
        ],
        "security": [],
        "responses": {
          "204": {
            "description": "<No Content>"
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "404": {
            "description": "PtyNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PtyNotFoundError"
                }
              }
            }
          }
        },
        "description": "Terminate and remove one PTY session.",
        "summary": "Remove PTY session",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.pty.remove({\n  ...\n})"
          }
        ]
      }
    },
    "/api/pty/{ptyID}/connect-token": {
      "post": {
        "tags": ["pty"],
        "operationId": "v2.pty.connectToken",
        "parameters": [
          {
            "name": "ptyID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^pty"
            },
            "required": true
          },
          {
            "name": "location",
            "in": "query",
            "schema": {
              "type": "object",
              "properties": {
                "directory": {
                  "type": "string"
                },
                "workspace": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "required": false,
            "style": "deepObject",
            "explode": true
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "location": {
                      "$ref": "#/components/schemas/LocationInfo"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PtyTicketConnectToken"
                    }
                  },
                  "required": ["location", "data"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "ForbiddenError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "PtyNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PtyNotFoundError"
                }
              }
            }
          }
        },
        "description": "Create a short-lived single-use ticket for opening a PTY WebSocket connection.",
        "summary": "Create PTY WebSocket token",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.pty.connectToken({\n  ...\n})"
          }
        ]
      }
    },
    "/api/pty/{ptyID}/connect": {
      "get": {
        "tags": ["pty"],
        "operationId": "v2.pty.connect",
        "parameters": [
          {
            "name": "ptyID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^pty"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "location[directory]",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "location[workspace]",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "ticket",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "403": {
            "description": "ForbiddenError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "404": {
            "description": "PtyNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PtyNotFoundError"
                }
              }
            }
          }
        },
        "description": "Establish a WebSocket connection streaming PTY output and accepting terminal input.",
        "summary": "Connect to PTY session",
        "x-websocket": true,
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.pty.connect({\n  ...\n})"
          }
        ]
      }
    },
    "/api/question/request": {
      "get": {
        "tags": ["session questions"],
        "operationId": "v2.question.request.list",
        "parameters": [
          {
            "name": "location",
            "in": "query",
            "schema": {
              "type": "object",
              "properties": {
                "directory": {
                  "type": "string"
                },
                "workspace": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "required": false,
            "style": "deepObject",
            "explode": true
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "location": {
                      "$ref": "#/components/schemas/LocationInfo"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/QuestionV2Request"
                      }
                    }
                  },
                  "required": ["location", "data"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          }
        },
        "description": "Retrieve pending question requests for a location.",
        "summary": "List pending question requests",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.question.request.list({\n  ...\n})"
          }
        ]
      }
    },
    "/api/session/{sessionID}/question": {
      "get": {
        "tags": ["session questions"],
        "operationId": "v2.session.question.list",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/QuestionV2Request"
                      }
                    }
                  },
                  "required": ["data"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "404": {
            "description": "SessionNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    },
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Retrieve pending question requests owned by a session.",
        "summary": "List session question requests",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.question.list({\n  ...\n})"
          }
        ]
      }
    },
    "/api/session/{sessionID}/question/{requestID}/reply": {
      "post": {
        "tags": ["session questions"],
        "operationId": "v2.session.question.reply",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          },
          {
            "name": "requestID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^que"
            },
            "required": true
          }
        ],
        "security": [],
        "responses": {
          "204": {
            "description": "<No Content>"
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "404": {
            "description": "SessionNotFoundError | QuestionNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/QuestionNotFoundError"
                    },
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    },
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Answer a pending question request owned by a session.",
        "summary": "Reply to pending question request",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuestionV2Reply"
              }
            }
          },
          "required": true
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.question.reply({\n  ...\n})"
          }
        ]
      }
    },
    "/api/session/{sessionID}/question/{requestID}/reject": {
      "post": {
        "tags": ["session questions"],
        "operationId": "v2.session.question.reject",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^ses"
            },
            "required": true
          },
          {
            "name": "requestID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^que"
            },
            "required": true
          }
        ],
        "security": [],
        "responses": {
          "204": {
            "description": "<No Content>"
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "404": {
            "description": "SessionNotFoundError | QuestionNotFoundError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/QuestionNotFoundError"
                    },
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    },
                    {
                      "$ref": "#/components/schemas/SessionNotFoundError"
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Reject a pending question request owned by a session.",
        "summary": "Reject pending question request",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.question.reject({\n  ...\n})"
          }
        ]
      }
    },
    "/api/reference": {
      "get": {
        "tags": ["reference"],
        "operationId": "v2.reference.list",
        "parameters": [
          {
            "name": "location",
            "in": "query",
            "schema": {
              "type": "object",
              "properties": {
                "directory": {
                  "type": "string"
                },
                "workspace": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "required": false,
            "style": "deepObject",
            "explode": true
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "location": {
                      "$ref": "#/components/schemas/LocationInfo"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ReferenceInfo"
                      }
                    }
                  },
                  "required": ["location", "data"],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              }
            }
          },
          "401": {
            "description": "UnauthorizedError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          }
        },
        "description": "List references available in the requested location.",
        "summary": "List references",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.reference.list({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/project/{projectID}/copy": {
      "post": {
        "tags": ["projectCopy"],
        "operationId": "v2.projectCopy.create",
        "parameters": [
          {
            "name": "projectID",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "location",
            "in": "query",
            "schema": {
              "type": "object",
              "properties": {
                "directory": {
                  "type": "string"
                },
                "workspace": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "required": false,
            "style": "deepObject",
            "explode": true
          }
        ],
        "responses": {
          "200": {
            "description": "ProjectCopy.Copy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectCopyCopy"
                }
              }
            }
          },
          "400": {
            "description": "ProjectCopyError | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ProjectCopyError"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "strategy": {
                    "type": "string"
                  },
                  "directory": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": ["strategy", "directory"],
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.projectCopy.create({\n  ...\n})"
          }
        ]
      },
      "delete": {
        "tags": ["projectCopy"],
        "operationId": "v2.projectCopy.remove",
        "parameters": [
          {
            "name": "projectID",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "location",
            "in": "query",
            "schema": {
              "type": "object",
              "properties": {
                "directory": {
                  "type": "string"
                },
                "workspace": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "required": false,
            "style": "deepObject",
            "explode": true
          }
        ],
        "responses": {
          "204": {
            "description": "<No Content>"
          },
          "400": {
            "description": "ProjectCopyError | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ProjectCopyError"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "directory": {
                    "type": "string"
                  },
                  "force": {
                    "type": "boolean"
                  }
                },
                "required": ["directory", "force"],
                "additionalProperties": false
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.projectCopy.remove({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/project/{projectID}/copy/refresh": {
      "post": {
        "tags": ["projectCopy"],
        "operationId": "v2.projectCopy.refresh",
        "parameters": [
          {
            "name": "projectID",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "location",
            "in": "query",
            "schema": {
              "type": "object",
              "properties": {
                "directory": {
                  "type": "string"
                },
                "workspace": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "required": false,
            "style": "deepObject",
            "explode": true
          }
        ],
        "responses": {
          "204": {
            "description": "<No Content>"
          },
          "400": {
            "description": "ProjectCopyError | InvalidRequestError",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ProjectCopyError"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidRequestError"
                    }
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.projectCopy.refresh({\n  ...\n})"
          }
        ]
      }
    },
    "/pty/{ptyID}/connect": {
      "get": {
        "tags": ["pty"],
        "operationId": "pty.connect",
        "parameters": [
          {
            "name": "ptyID",
            "in": "path",
            "schema": {
              "type": "string",
              "pattern": "^pty"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "ticket",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Connected session",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "description": "Connected session"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/effect_HttpApiError_Forbidden"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "description": "Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.",
        "summary": "Connect to PTY session",
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connect({\n  ...\n})"
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "Event": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/EventModels-devRefreshed"
          },
          {
            "$ref": "#/components/schemas/EventIntegrationUpdated"
          },
          {
            "$ref": "#/components/schemas/EventIntegrationConnectionUpdated"
          },
          {
            "$ref": "#/components/schemas/EventCatalogUpdated"
          },
          {
            "$ref": "#/components/schemas/EventSessionCreated"
          },
          {
            "$ref": "#/components/schemas/EventSessionUpdated"
          },
          {
            "$ref": "#/components/schemas/EventSessionDeleted"
          },
          {
            "$ref": "#/components/schemas/EventMessageUpdated"
          },
          {
            "$ref": "#/components/schemas/EventMessageRemoved"
          },
          {
            "$ref": "#/components/schemas/EventMessagePartUpdated"
          },
          {
            "$ref": "#/components/schemas/EventMessagePartRemoved"
          },
          {
            "$ref": "#/components/schemas/EventSessionNextAgentSwitched"
          },
          {
            "$ref": "#/components/schemas/EventSessionNextModelSwitched"
          },
          {
            "$ref": "#/components/schemas/EventSessionNextMoved"
          },
          {
            "$ref": "#/components/schemas/EventSessionNextPrompted"
          },
          {
            "$ref": "#/components/schemas/EventSessionNextPromptAdmitted"
          },
          {
            "$ref": "#/components/schemas/EventSessionNextContextUpdated"
          },
          {
            "$ref": "#/components/schemas/EventSessionNextSynthetic"
          },
          {
            "$ref": "#/components/schemas/EventSessionNextShellStarted"
          },
          {
            "$ref": "#/components/schemas/EventSessionNextShellEnded"
          },
          {
            "$ref": "#/components/schemas/EventSessionNextStepStarted"
          },
          {
            "$ref": "#/components/schemas/EventSessionNextStepEnded"
          },
          {
            "$ref": "#/components/schemas/EventSessionNextStepFailed"
          },
          {
            "$ref": "#/components/schemas/EventSessionNextTextStarted"
          },
          {
            "$ref": "#/components/schemas/EventSessionNextTextDelta"
          },
          {
            "$ref": "#/components/schemas/EventSessionNextTextEnded"
          },
          {
            "$ref": "#/components/schemas/EventSessionNextReasoningStarted"
          },
          {
            "$ref": "#/components/schemas/EventSessionNextReasoningDelta"
          },
          {
            "$ref": "#/components/schemas/EventSessionNextReasoningEnded"
          },
          {
            "$ref": "#/components/schemas/EventSessionNextToolInputStarted"
          },
          {
            "$ref": "#/components/schemas/EventSessionNextToolInputDelta"
          },
          {
            "$ref": "#/components/schemas/EventSessionNextToolInputEnded"
          },
          {
            "$ref": "#/components/schemas/EventSessionNextToolCalled"
          },
          {
            "$ref": "#/components/schemas/EventSessionNextToolProgress"
          },
          {
            "$ref": "#/components/schemas/EventSessionNextToolSuccess"
          },
          {
            "$ref": "#/components/schemas/EventSessionNextToolFailed"
          },
          {
            "$ref": "#/components/schemas/EventSessionNextRetried"
          },
          {
            "$ref": "#/components/schemas/EventSessionNextCompactionStarted"
          },
          {
            "$ref": "#/components/schemas/EventSessionNextCompactionDelta"
          },
          {
            "$ref": "#/components/schemas/EventSessionNextCompactionEnded"
          },
          {
            "$ref": "#/components/schemas/EventSessionNextRevertStaged"
          },
          {
            "$ref": "#/components/schemas/EventSessionNextRevertCleared"
          },
          {
            "$ref": "#/components/schemas/EventSessionNextRevertCommitted"
          },
          {
            "$ref": "#/components/schemas/EventMessagePartDelta"
          },
          {
            "$ref": "#/components/schemas/EventSessionDiff"
          },
          {
            "$ref": "#/components/schemas/EventSessionError"
          },
          {
            "$ref": "#/components/schemas/EventInstallationUpdated"
          },
          {
            "$ref": "#/components/schemas/EventInstallationUpdate-available"
          },
          {
            "$ref": "#/components/schemas/EventFileEdited"
          },
          {
            "$ref": "#/components/schemas/EventReferenceUpdated"
          },
          {
            "$ref": "#/components/schemas/EventPermissionV2Asked"
          },
          {
            "$ref": "#/components/schemas/EventPermissionV2Replied"
          },
          {
            "$ref": "#/components/schemas/EventPluginAdded"
          },
          {
            "$ref": "#/components/schemas/EventProjectDirectoriesUpdated"
          },
          {
            "$ref": "#/components/schemas/EventFileWatcherUpdated"
          },
          {
            "$ref": "#/components/schemas/EventPtyCreated"
          },
          {
            "$ref": "#/components/schemas/EventPtyUpdated"
          },
          {
            "$ref": "#/components/schemas/EventPtyExited"
          },
          {
            "$ref": "#/components/schemas/EventPtyDeleted"
          },
          {
            "$ref": "#/components/schemas/EventQuestionV2Asked"
          },
          {
            "$ref": "#/components/schemas/EventQuestionV2Replied"
          },
          {
            "$ref": "#/components/schemas/EventQuestionV2Rejected"
          },
          {
            "$ref": "#/components/schemas/EventLspUpdated"
          },
          {
            "$ref": "#/components/schemas/EventPermissionAsked"
          },
          {
            "$ref": "#/components/schemas/EventPermissionReplied"
          },
          {
            "$ref": "#/components/schemas/Event.tui.prompt.append"
          },
          {
            "$ref": "#/components/schemas/Event.tui.command.execute"
          },
          {
            "$ref": "#/components/schemas/Event.tui.toast.show"
          },
          {
            "$ref": "#/components/schemas/Event.tui.session.select"
          },
          {
            "$ref": "#/components/schemas/EventMcpToolsChanged"
          },
          {
            "$ref": "#/components/schemas/EventMcpBrowserOpenFailed"
          },
          {
            "$ref": "#/components/schemas/EventCommandExecuted"
          },
          {
            "$ref": "#/components/schemas/EventProjectUpdated"
          },
          {
            "$ref": "#/components/schemas/EventSessionStatus"
          },
          {
            "$ref": "#/components/schemas/EventSessionIdle"
          },
          {
            "$ref": "#/components/schemas/EventQuestionAsked"
          },
          {
            "$ref": "#/components/schemas/EventQuestionReplied"
          },
          {
            "$ref": "#/components/schemas/EventQuestionRejected"
          },
          {
            "$ref": "#/components/schemas/EventSessionCompacted"
          },
          {
            "$ref": "#/components/schemas/EventVcsBranchUpdated"
          },
          {
            "$ref": "#/components/schemas/EventWorkspaceReady"
          },
          {
            "$ref": "#/components/schemas/EventWorkspaceFailed"
          },
          {
            "$ref": "#/components/schemas/EventWorkspaceStatus"
          },
          {
            "$ref": "#/components/schemas/EventWorktreeReady"
          },
          {
            "$ref": "#/components/schemas/EventWorktreeFailed"
          },
          {
            "$ref": "#/components/schemas/EventServerConnected"
          },
          {
            "$ref": "#/components/schemas/EventGlobalDisposed"
          },
          {
            "$ref": "#/components/schemas/EventServerInstanceDisposed"
          }
        ]
      },
      "QuestionReplied": {
        "type": "object",
        "properties": {
          "sessionID": {
            "type": "string",
            "pattern": "^ses"
          },
          "requestID": {
            "type": "string",
            "pattern": "^que"
          },
          "answers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuestionAnswer"
            }
          }
        },
        "required": ["sessionID", "requestID", "answers"],
        "additionalProperties": false
      },
      "QuestionRejected": {
        "type": "object",
        "properties": {
          "sessionID": {
            "type": "string",
            "pattern": "^ses"
          },
          "requestID": {
            "type": "string",
            "pattern": "^que"
          }
        },
        "required": ["sessionID", "requestID"],
        "additionalProperties": false
      },
      "OAuth": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["oauth"]
          },
          "refresh": {
            "type": "string"
          },
          "access": {
            "type": "string"
          },
          "expires": {
            "type": "integer",
            "minimum": 0
          },
          "accountId": {
            "type": "string"
          },
          "enterpriseUrl": {
            "type": "string"
          }
        },
        "required": ["type", "refresh", "access", "expires"],
        "additionalProperties": false
      },
      "ApiAuth": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["api"]
          },
          "key": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "required": ["type", "key"],
        "additionalProperties": false
      },
      "WellKnownAuth": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["wellknown"]
          },
          "key": {
            "type": "string"
          },
          "token": {
            "type": "string"
          }
        },
        "required": ["type", "key", "token"],
        "additionalProperties": false
      },
      "Auth": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/OAuth"
          },
          {
            "$ref": "#/components/schemas/ApiAuth"
          },
          {
            "$ref": "#/components/schemas/WellKnownAuth"
          }
        ]
      },
      "effect_HttpApiError_BadRequest": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": ["BadRequest"]
          }
        },
        "required": ["_tag"],
        "additionalProperties": false
      },
      "InvalidRequestError": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": ["InvalidRequestError"]
          },
          "message": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "field": {
            "type": "string"
          }
        },
        "required": ["_tag", "message"],
        "additionalProperties": false
      },
      "MoveSessionError": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": ["MoveSessionError"]
          },
          "data": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              }
            },
            "required": ["message"],
            "additionalProperties": false
          }
        },
        "required": ["name", "data"],
        "additionalProperties": false
      },
      "SnapshotFileDiff": {
        "type": "object",
        "properties": {
          "file": {
            "type": "string"
          },
          "patch": {
            "type": "string"
          },
          "additions": {
            "type": "number"
          },
          "deletions": {
            "type": "number"
          },
          "status": {
            "type": "string",
            "enum": ["added", "deleted", "modified"]
          }
        },
        "required": ["additions", "deletions"],
        "additionalProperties": false
      },
      "PermissionAction": {
        "type": "string",
        "enum": ["allow", "deny", "ask"]
      },
      "PermissionRule": {
        "type": "object",
        "properties": {
          "permission": {
            "type": "string"
          },
          "pattern": {
            "type": "string"
          },
          "action": {
            "$ref": "#/components/schemas/PermissionAction"
          }
        },
        "required": ["permission", "pattern", "action"],
        "additionalProperties": false
      },
      "PermissionRuleset": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/PermissionRule"
        }
      },
      "Session": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^ses"
          },
          "slug": {
            "type": "string"
          },
          "projectID": {
            "type": "string"
          },
          "workspaceID": {
            "type": "string",
            "pattern": "^wrk"
          },
          "directory": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "parentID": {
            "type": "string",
            "pattern": "^ses"
          },
          "summary": {
            "type": "object",
            "properties": {
              "additions": {
                "type": "number"
              },
              "deletions": {
                "type": "number"
              },
              "files": {
                "type": "number"
              },
              "diffs": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SnapshotFileDiff"
                }
              }
            },
            "required": ["additions", "deletions", "files"],
            "additionalProperties": false
          },
          "cost": {
            "type": "number"
          },
          "tokens": {
            "type": "object",
            "properties": {
              "input": {
                "type": "number"
              },
              "output": {
                "type": "number"
              },
              "reasoning": {
                "type": "number"
              },
              "cache": {
                "type": "object",
                "properties": {
                  "read": {
                    "type": "number"
                  },
                  "write": {
                    "type": "number"
                  }
                },
                "required": ["read", "write"],
                "additionalProperties": false
              }
            },
            "required": ["input", "output", "reasoning", "cache"],
            "additionalProperties": false
          },
          "share": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string"
              }
            },
            "required": ["url"],
            "additionalProperties": false
          },
          "title": {
            "type": "string"
          },
          "agent": {
            "type": "string"
          },
          "model": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "providerID": {
                "type": "string"
              },
              "variant": {
                "type": "string"
              }
            },
            "required": ["id", "providerID"],
            "additionalProperties": false
          },
          "version": {
            "type": "string"
          },
          "metadata": {
            "type": "object"
          },
          "time": {
            "type": "object",
            "properties": {
              "created": {
                "type": "integer",
                "minimum": 0
              },
              "updated": {
                "type": "integer",
                "minimum": 0
              },
              "compacting": {
                "type": "integer",
                "minimum": 0
              },
              "archived": {
                "type": "number"
              }
            },
            "required": ["created", "updated"],
            "additionalProperties": false
          },
          "permission": {
            "$ref": "#/components/schemas/PermissionRuleset"
          },
          "revert": {
            "type": "object",
            "properties": {
              "messageID": {
                "type": "string",
                "pattern": "^msg"
              },
              "partID": {
                "type": "string",
                "pattern": "^prt"
              },
              "snapshot": {
                "type": "string"
              },
              "diff": {
                "type": "string"
              }
            },
            "required": ["messageID"],
            "additionalProperties": false
          }
        },
        "required": ["id", "slug", "projectID", "directory", "title", "version", "time"],
        "additionalProperties": false
      },
      "OutputFormatText": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["text"]
          }
        },
        "required": ["type"],
        "additionalProperties": false
      },
      "JSONSchema": {
        "type": "object"
      },
      "OutputFormatJsonSchema": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["json_schema"]
          },
          "schema": {
            "$ref": "#/components/schemas/JSONSchema"
          },
          "retryCount": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": ["type", "schema"],
        "additionalProperties": false
      },
      "OutputFormat": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/OutputFormatText"
          },
          {
            "$ref": "#/components/schemas/OutputFormatJsonSchema"
          }
        ]
      },
      "UserMessage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^msg"
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses"
          },
          "role": {
            "type": "string",
            "enum": ["user"]
          },
          "time": {
            "type": "object",
            "properties": {
              "created": {
                "type": "number",
                "minimum": 0
              }
            },
            "required": ["created"],
            "additionalProperties": false
          },
          "format": {
            "$ref": "#/components/schemas/OutputFormat"
          },
          "summary": {
            "type": "object",
            "properties": {
              "title": {
                "type": "string"
              },
              "body": {
                "type": "string"
              },
              "diffs": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SnapshotFileDiff"
                }
              }
            },
            "required": ["diffs"],
            "additionalProperties": false
          },
          "agent": {
            "type": "string"
          },
          "model": {
            "type": "object",
            "properties": {
              "providerID": {
                "type": "string"
              },
              "modelID": {
                "type": "string"
              },
              "variant": {
                "type": "string"
              }
            },
            "required": ["providerID", "modelID"],
            "additionalProperties": false
          },
          "system": {
            "type": "string"
          },
          "tools": {
            "type": "object",
            "additionalProperties": {
              "type": "boolean"
            }
          }
        },
        "required": ["id", "sessionID", "role", "time", "agent", "model"],
        "additionalProperties": false
      },
      "ProviderAuthError": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": ["ProviderAuthError"]
          },
          "data": {
            "type": "object",
            "properties": {
              "providerID": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": ["providerID", "message"],
            "additionalProperties": false
          }
        },
        "required": ["name", "data"],
        "additionalProperties": false
      },
      "UnknownError": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": ["UnknownError"]
          },
          "data": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              }
            },
            "required": ["message"],
            "additionalProperties": false
          }
        },
        "required": ["name", "data"],
        "additionalProperties": false
      },
      "MessageOutputLengthError": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": ["MessageOutputLengthError"]
          },
          "data": {
            "type": "object",
            "properties": {}
          }
        },
        "required": ["name", "data"],
        "additionalProperties": false
      },
      "MessageAbortedError": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": ["MessageAbortedError"]
          },
          "data": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              }
            },
            "required": ["message"],
            "additionalProperties": false
          }
        },
        "required": ["name", "data"],
        "additionalProperties": false
      },
      "StructuredOutputError": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": ["StructuredOutputError"]
          },
          "data": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              },
              "retries": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": ["message", "retries"],
            "additionalProperties": false
          }
        },
        "required": ["name", "data"],
        "additionalProperties": false
      },
      "ContextOverflowError": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": ["ContextOverflowError"]
          },
          "data": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              },
              "responseBody": {
                "type": "string"
              }
            },
            "required": ["message"],
            "additionalProperties": false
          }
        },
        "required": ["name", "data"],
        "additionalProperties": false
      },
      "ContentFilterError": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": ["ContentFilterError"]
          },
          "data": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              }
            },
            "required": ["message"],
            "additionalProperties": false
          }
        },
        "required": ["name", "data"],
        "additionalProperties": false
      },
      "APIError": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": ["APIError"]
          },
          "data": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              },
              "statusCode": {
                "type": "integer",
                "minimum": 0
              },
              "isRetryable": {
                "type": "boolean"
              },
              "responseHeaders": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              },
              "responseBody": {
                "type": "string"
              },
              "metadata": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              }
            },
            "required": ["message", "isRetryable"],
            "additionalProperties": false
          }
        },
        "required": ["name", "data"],
        "additionalProperties": false
      },
      "AssistantMessage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^msg"
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses"
          },
          "role": {
            "type": "string",
            "enum": ["assistant"]
          },
          "time": {
            "type": "object",
            "properties": {
              "created": {
                "type": "integer",
                "minimum": 0
              },
              "completed": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": ["created"],
            "additionalProperties": false
          },
          "error": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ProviderAuthError"
              },
              {
                "$ref": "#/components/schemas/UnknownError"
              },
              {
                "$ref": "#/components/schemas/MessageOutputLengthError"
              },
              {
                "$ref": "#/components/schemas/MessageAbortedError"
              },
              {
                "$ref": "#/components/schemas/StructuredOutputError"
              },
              {
                "$ref": "#/components/schemas/ContextOverflowError"
              },
              {
                "$ref": "#/components/schemas/ContentFilterError"
              },
              {
                "$ref": "#/components/schemas/APIError"
              }
            ]
          },
          "parentID": {
            "type": "string",
            "pattern": "^msg"
          },
          "modelID": {
            "type": "string"
          },
          "providerID": {
            "type": "string"
          },
          "mode": {
            "type": "string"
          },
          "agent": {
            "type": "string"
          },
          "path": {
            "type": "object",
            "properties": {
              "cwd": {
                "type": "string"
              },
              "root": {
                "type": "string"
              }
            },
            "required": ["cwd", "root"],
            "additionalProperties": false
          },
          "summary": {
            "type": "boolean"
          },
          "cost": {
            "type": "number"
          },
          "tokens": {
            "type": "object",
            "properties": {
              "total": {
                "type": "number"
              },
              "input": {
                "type": "number"
              },
              "output": {
                "type": "number"
              },
              "reasoning": {
                "type": "number"
              },
              "cache": {
                "type": "object",
                "properties": {
                  "read": {
                    "type": "number"
                  },
                  "write": {
                    "type": "number"
                  }
                },
                "required": ["read", "write"],
                "additionalProperties": false
              }
            },
            "required": ["input", "output", "reasoning", "cache"],
            "additionalProperties": false
          },
          "structured": {},
          "variant": {
            "type": "string"
          },
          "finish": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "sessionID",
          "role",
          "time",
          "parentID",
          "modelID",
          "providerID",
          "mode",
          "agent",
          "path",
          "cost",
          "tokens"
        ],
        "additionalProperties": false
      },
      "Message": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/UserMessage"
          },
          {
            "$ref": "#/components/schemas/AssistantMessage"
          }
        ]
      },
      "TextPart": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prt"
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses"
          },
          "messageID": {
            "type": "string",
            "pattern": "^msg"
          },
          "type": {
            "type": "string",
            "enum": ["text"]
          },
          "text": {
            "type": "string"
          },
          "session.synthetic": {
            "type": "boolean"
          },
          "ignored": {
            "type": "boolean"
          },
          "time": {
            "type": "object",
            "properties": {
              "start": {
                "type": "integer",
                "minimum": 0
              },
              "end": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": ["start"],
            "additionalProperties": false
          },
          "metadata": {
            "type": "object"
          }
        },
        "required": ["id", "sessionID", "messageID", "type", "text"],
        "additionalProperties": false
      },
      "SubtaskPart": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prt"
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses"
          },
          "messageID": {
            "type": "string",
            "pattern": "^msg"
          },
          "type": {
            "type": "string",
            "enum": ["subtask"]
          },
          "prompt": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "agent": {
            "type": "string"
          },
          "model": {
            "type": "object",
            "properties": {
              "providerID": {
                "type": "string"
              },
              "modelID": {
                "type": "string"
              }
            },
            "required": ["providerID", "modelID"],
            "additionalProperties": false
          },
          "command": {
            "type": "string"
          }
        },
        "required": ["id", "sessionID", "messageID", "type", "prompt", "description", "agent"],
        "additionalProperties": false
      },
      "ReasoningPart": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prt"
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses"
          },
          "messageID": {
            "type": "string",
            "pattern": "^msg"
          },
          "type": {
            "type": "string",
            "enum": ["reasoning"]
          },
          "text": {
            "type": "string"
          },
          "metadata": {
            "type": "object"
          },
          "time": {
            "type": "object",
            "properties": {
              "start": {
                "type": "integer",
                "minimum": 0
              },
              "end": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": ["start"],
            "additionalProperties": false
          }
        },
        "required": ["id", "sessionID", "messageID", "type", "text", "time"],
        "additionalProperties": false
      },
      "FilePartSourceText": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string"
          },
          "start": {
            "type": "number"
          },
          "end": {
            "type": "number"
          }
        },
        "required": ["value", "start", "end"],
        "additionalProperties": false
      },
      "FileSource": {
        "type": "object",
        "properties": {
          "text": {
            "$ref": "#/components/schemas/FilePartSourceText"
          },
          "type": {
            "type": "string",
            "enum": ["file"]
          },
          "path": {
            "type": "string"
          }
        },
        "required": ["text", "type", "path"],
        "additionalProperties": false
      },
      "Range": {
        "type": "object",
        "properties": {
          "start": {
            "type": "object",
            "properties": {
              "line": {
                "type": "integer",
                "minimum": 0
              },
              "character": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": ["line", "character"],
            "additionalProperties": false
          },
          "end": {
            "type": "object",
            "properties": {
              "line": {
                "type": "integer",
                "minimum": 0
              },
              "character": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": ["line", "character"],
            "additionalProperties": false
          }
        },
        "required": ["start", "end"],
        "additionalProperties": false
      },
      "SymbolSource": {
        "type": "object",
        "properties": {
          "text": {
            "$ref": "#/components/schemas/FilePartSourceText"
          },
          "type": {
            "type": "string",
            "enum": ["symbol"]
          },
          "path": {
            "type": "string"
          },
          "range": {
            "$ref": "#/components/schemas/Range"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": ["text", "type", "path", "range", "name", "kind"],
        "additionalProperties": false
      },
      "ResourceSource": {
        "type": "object",
        "properties": {
          "text": {
            "$ref": "#/components/schemas/FilePartSourceText"
          },
          "type": {
            "type": "string",
            "enum": ["resource"]
          },
          "clientName": {
            "type": "string"
          },
          "uri": {
            "type": "string"
          }
        },
        "required": ["text", "type", "clientName", "uri"],
        "additionalProperties": false
      },
      "FilePartSource": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/FileSource"
          },
          {
            "$ref": "#/components/schemas/SymbolSource"
          },
          {
            "$ref": "#/components/schemas/ResourceSource"
          }
        ]
      },
      "FilePart": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prt"
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses"
          },
          "messageID": {
            "type": "string",
            "pattern": "^msg"
          },
          "type": {
            "type": "string",
            "enum": ["file"]
          },
          "mime": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "source": {
            "$ref": "#/components/schemas/FilePartSource"
          }
        },
        "required": ["id", "sessionID", "messageID", "type", "mime", "url"],
        "additionalProperties": false
      },
      "ToolStatePending": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": ["pending"]
          },
          "input": {
            "type": "object"
          },
          "raw": {
            "type": "string"
          }
        },
        "required": ["status", "input", "raw"],
        "additionalProperties": false
      },
      "ToolStateRunning": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": ["running"]
          },
          "input": {
            "type": "object"
          },
          "title": {
            "type": "string"
          },
          "metadata": {
            "type": "object"
          },
          "time": {
            "type": "object",
            "properties": {
              "start": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": ["start"],
            "additionalProperties": false
          }
        },
        "required": ["status", "input", "time"],
        "additionalProperties": false
      },
      "ToolStateCompleted": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": ["completed"]
          },
          "input": {
            "type": "object"
          },
          "output": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "metadata": {
            "type": "object"
          },
          "time": {
            "type": "object",
            "properties": {
              "start": {
                "type": "integer",
                "minimum": 0
              },
              "end": {
                "type": "integer",
                "minimum": 0
              },
              "compacted": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": ["start", "end"],
            "additionalProperties": false
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FilePart"
            }
          }
        },
        "required": ["status", "input", "output", "title", "metadata", "time"],
        "additionalProperties": false
      },
      "ToolStateError": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": ["error"]
          },
          "input": {
            "type": "object"
          },
          "error": {
            "type": "string"
          },
          "metadata": {
            "type": "object"
          },
          "time": {
            "type": "object",
            "properties": {
              "start": {
                "type": "integer",
                "minimum": 0
              },
              "end": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": ["start", "end"],
            "additionalProperties": false
          }
        },
        "required": ["status", "input", "error", "time"],
        "additionalProperties": false
      },
      "ToolState": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/ToolStatePending"
          },
          {
            "$ref": "#/components/schemas/ToolStateRunning"
          },
          {
            "$ref": "#/components/schemas/ToolStateCompleted"
          },
          {
            "$ref": "#/components/schemas/ToolStateError"
          }
        ]
      },
      "ToolPart": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prt"
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses"
          },
          "messageID": {
            "type": "string",
            "pattern": "^msg"
          },
          "type": {
            "type": "string",
            "enum": ["tool"]
          },
          "callID": {
            "type": "string"
          },
          "tool": {
            "type": "string"
          },
          "state": {
            "$ref": "#/components/schemas/ToolState"
          },
          "metadata": {
            "type": "object"
          }
        },
        "required": ["id", "sessionID", "messageID", "type", "callID", "tool", "state"],
        "additionalProperties": false
      },
      "StepStartPart": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prt"
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses"
          },
          "messageID": {
            "type": "string",
            "pattern": "^msg"
          },
          "type": {
            "type": "string",
            "enum": ["step-start"]
          },
          "snapshot": {
            "type": "string"
          }
        },
        "required": ["id", "sessionID", "messageID", "type"],
        "additionalProperties": false
      },
      "StepFinishPart": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prt"
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses"
          },
          "messageID": {
            "type": "string",
            "pattern": "^msg"
          },
          "type": {
            "type": "string",
            "enum": ["step-finish"]
          },
          "reason": {
            "type": "string"
          },
          "snapshot": {
            "type": "string"
          },
          "cost": {
            "type": "number"
          },
          "tokens": {
            "type": "object",
            "properties": {
              "total": {
                "type": "number"
              },
              "input": {
                "type": "number"
              },
              "output": {
                "type": "number"
              },
              "reasoning": {
                "type": "number"
              },
              "cache": {
                "type": "object",
                "properties": {
                  "read": {
                    "type": "number"
                  },
                  "write": {
                    "type": "number"
                  }
                },
                "required": ["read", "write"],
                "additionalProperties": false
              }
            },
            "required": ["input", "output", "reasoning", "cache"],
            "additionalProperties": false
          }
        },
        "required": ["id", "sessionID", "messageID", "type", "reason", "cost", "tokens"],
        "additionalProperties": false
      },
      "SnapshotPart": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prt"
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses"
          },
          "messageID": {
            "type": "string",
            "pattern": "^msg"
          },
          "type": {
            "type": "string",
            "enum": ["snapshot"]
          },
          "snapshot": {
            "type": "string"
          }
        },
        "required": ["id", "sessionID", "messageID", "type", "snapshot"],
        "additionalProperties": false
      },
      "PatchPart": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prt"
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses"
          },
          "messageID": {
            "type": "string",
            "pattern": "^msg"
          },
          "type": {
            "type": "string",
            "enum": ["patch"]
          },
          "hash": {
            "type": "string"
          },
          "files": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": ["id", "sessionID", "messageID", "type", "hash", "files"],
        "additionalProperties": false
      },
      "AgentPart": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prt"
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses"
          },
          "messageID": {
            "type": "string",
            "pattern": "^msg"
          },
          "type": {
            "type": "string",
            "enum": ["agent"]
          },
          "name": {
            "type": "string"
          },
          "source": {
            "type": "object",
            "properties": {
              "value": {
                "type": "string"
              },
              "start": {
                "type": "integer",
                "minimum": 0
              },
              "end": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": ["value", "start", "end"],
            "additionalProperties": false
          }
        },
        "required": ["id", "sessionID", "messageID", "type", "name"],
        "additionalProperties": false
      },
      "RetryPart": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prt"
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses"
          },
          "messageID": {
            "type": "string",
            "pattern": "^msg"
          },
          "type": {
            "type": "string",
            "enum": ["retry"]
          },
          "attempt": {
            "type": "integer",
            "minimum": 0
          },
          "error": {
            "$ref": "#/components/schemas/APIError"
          },
          "time": {
            "type": "object",
            "properties": {
              "created": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": ["created"],
            "additionalProperties": false
          }
        },
        "required": ["id", "sessionID", "messageID", "type", "attempt", "error", "time"],
        "additionalProperties": false
      },
      "CompactionPart": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prt"
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses"
          },
          "messageID": {
            "type": "string",
            "pattern": "^msg"
          },
          "type": {
            "type": "string",
            "enum": ["compaction"]
          },
          "auto": {
            "type": "boolean"
          },
          "overflow": {
            "type": "boolean"
          },
          "tail_start_id": {
            "type": "string",
            "pattern": "^msg"
          }
        },
        "required": ["id", "sessionID", "messageID", "type", "auto"],
        "additionalProperties": false
      },
      "Part": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/TextPart"
          },
          {
            "$ref": "#/components/schemas/SubtaskPart"
          },
          {
            "$ref": "#/components/schemas/ReasoningPart"
          },
          {
            "$ref": "#/components/schemas/FilePart"
          },
          {
            "$ref": "#/components/schemas/ToolPart"
          },
          {
            "$ref": "#/components/schemas/StepStartPart"
          },
          {
            "$ref": "#/components/schemas/StepFinishPart"
          },
          {
            "$ref": "#/components/schemas/SnapshotPart"
          },
          {
            "$ref": "#/components/schemas/PatchPart"
          },
          {
            "$ref": "#/components/schemas/AgentPart"
          },
          {
            "$ref": "#/components/schemas/RetryPart"
          },
          {
            "$ref": "#/components/schemas/CompactionPart"
          }
        ]
      },
      "Prompt": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PromptFileAttachment"
            }
          },
          "agents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PromptAgentAttachment"
            }
          }
        },
        "required": ["text"],
        "additionalProperties": false
      },
      "Pty": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^pty"
          },
          "title": {
            "type": "string"
          },
          "command": {
            "type": "string"
          },
          "args": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "cwd": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": ["running", "exited"]
          },
          "pid": {
            "type": "integer",
            "minimum": 0
          },
          "exitCode": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": ["id", "title", "command", "args", "cwd", "status", "pid"],
        "additionalProperties": false
      },
      "SessionStatus": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["idle"]
              }
            },
            "required": ["type"],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["retry"]
              },
              "attempt": {
                "type": "integer",
                "minimum": 0
              },
              "message": {
                "type": "string"
              },
              "action": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string"
                  },
                  "provider": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string"
                  },
                  "label": {
                    "type": "string"
                  },
                  "link": {
                    "type": "string"
                  }
                },
                "required": ["reason", "provider", "title", "message", "label"],
                "additionalProperties": false
              },
              "next": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": ["type", "attempt", "message", "next"],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["busy"]
              }
            },
            "required": ["type"],
            "additionalProperties": false
          }
        ]
      },
      "QuestionOption": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "description": "Display text (1-5 words, concise)"
          },
          "description": {
            "type": "string",
            "description": "Explanation of choice"
          }
        },
        "required": ["label", "description"],
        "additionalProperties": false
      },
      "QuestionInfo": {
        "type": "object",
        "properties": {
          "question": {
            "type": "string",
            "description": "Complete question"
          },
          "header": {
            "type": "string",
            "description": "Very short label (max 30 chars)"
          },
          "options": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuestionOption"
            },
            "description": "Available choices"
          },
          "multiple": {
            "type": "boolean"
          },
          "custom": {
            "type": "boolean"
          }
        },
        "required": ["question", "header", "options"],
        "additionalProperties": false
      },
      "QuestionTool": {
        "type": "object",
        "properties": {
          "messageID": {
            "type": "string",
            "pattern": "^msg"
          },
          "callID": {
            "type": "string"
          }
        },
        "required": ["messageID", "callID"],
        "additionalProperties": false
      },
      "QuestionAnswer": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "GlobalEvent": {
        "type": "object",
        "properties": {
          "directory": {
            "type": "string"
          },
          "project": {
            "type": "string"
          },
          "workspace": {
            "type": "string"
          },
          "payload": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["models-dev.refreshed"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {}
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["integration.updated"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {}
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["integration.connection.updated"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "integrationID": {
                        "type": "string"
                      }
                    },
                    "required": ["integrationID"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["catalog.updated"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {}
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.created"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "info": {
                        "$ref": "#/components/schemas/Session"
                      }
                    },
                    "required": ["sessionID", "info"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.updated"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "info": {
                        "$ref": "#/components/schemas/Session"
                      }
                    },
                    "required": ["sessionID", "info"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.deleted"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "info": {
                        "$ref": "#/components/schemas/Session"
                      }
                    },
                    "required": ["sessionID", "info"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["message.updated"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "info": {
                        "$ref": "#/components/schemas/Message"
                      }
                    },
                    "required": ["sessionID", "info"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["message.removed"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "messageID": {
                        "type": "string",
                        "pattern": "^msg"
                      }
                    },
                    "required": ["sessionID", "messageID"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["message.part.updated"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "part": {
                        "$ref": "#/components/schemas/Part"
                      },
                      "time": {
                        "type": "number"
                      }
                    },
                    "required": ["sessionID", "part", "time"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["message.part.removed"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "messageID": {
                        "type": "string",
                        "pattern": "^msg"
                      },
                      "partID": {
                        "type": "string",
                        "pattern": "^prt"
                      }
                    },
                    "required": ["sessionID", "messageID", "partID"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.next.agent.switched"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "number"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "messageID": {
                        "type": "string",
                        "pattern": "^msg_"
                      },
                      "agent": {
                        "type": "string"
                      }
                    },
                    "required": ["timestamp", "sessionID", "messageID", "agent"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.next.model.switched"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "number"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "messageID": {
                        "type": "string",
                        "pattern": "^msg_"
                      },
                      "model": {
                        "$ref": "#/components/schemas/ModelRef"
                      }
                    },
                    "required": ["timestamp", "sessionID", "messageID", "model"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.next.moved"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "number"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "location": {
                        "$ref": "#/components/schemas/LocationRef"
                      },
                      "subdirectory": {
                        "type": "string"
                      }
                    },
                    "required": ["timestamp", "sessionID", "location"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.next.prompted"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "number"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "messageID": {
                        "type": "string",
                        "pattern": "^msg_"
                      },
                      "prompt": {
                        "$ref": "#/components/schemas/Prompt"
                      },
                      "delivery": {
                        "type": "string",
                        "enum": ["steer", "queue"]
                      }
                    },
                    "required": ["timestamp", "sessionID", "messageID", "prompt", "delivery"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.next.prompt.admitted"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "number"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "messageID": {
                        "type": "string",
                        "pattern": "^msg_"
                      },
                      "prompt": {
                        "$ref": "#/components/schemas/Prompt"
                      },
                      "delivery": {
                        "type": "string",
                        "enum": ["steer", "queue"]
                      }
                    },
                    "required": ["timestamp", "sessionID", "messageID", "prompt", "delivery"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.next.context.updated"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "number"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "messageID": {
                        "type": "string",
                        "pattern": "^msg_"
                      },
                      "text": {
                        "type": "string"
                      }
                    },
                    "required": ["timestamp", "sessionID", "messageID", "text"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.next.synthetic"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "number"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "messageID": {
                        "type": "string",
                        "pattern": "^msg_"
                      },
                      "text": {
                        "type": "string"
                      }
                    },
                    "required": ["timestamp", "sessionID", "messageID", "text"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.next.shell.started"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "number"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "messageID": {
                        "type": "string",
                        "pattern": "^msg_"
                      },
                      "callID": {
                        "type": "string"
                      },
                      "command": {
                        "type": "string"
                      }
                    },
                    "required": ["timestamp", "sessionID", "messageID", "callID", "command"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.next.shell.ended"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "number"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "callID": {
                        "type": "string"
                      },
                      "output": {
                        "type": "string"
                      }
                    },
                    "required": ["timestamp", "sessionID", "callID", "output"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.next.step.started"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "number"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "assistantMessageID": {
                        "type": "string",
                        "pattern": "^msg_"
                      },
                      "agent": {
                        "type": "string"
                      },
                      "model": {
                        "$ref": "#/components/schemas/ModelRef"
                      },
                      "snapshot": {
                        "type": "string"
                      }
                    },
                    "required": ["timestamp", "sessionID", "assistantMessageID", "agent", "model"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.next.step.ended"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "number"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "assistantMessageID": {
                        "type": "string",
                        "pattern": "^msg_"
                      },
                      "finish": {
                        "type": "string"
                      },
                      "cost": {
                        "type": "number"
                      },
                      "tokens": {
                        "type": "object",
                        "properties": {
                          "input": {
                            "type": "number"
                          },
                          "output": {
                            "type": "number"
                          },
                          "reasoning": {
                            "type": "number"
                          },
                          "cache": {
                            "type": "object",
                            "properties": {
                              "read": {
                                "type": "number"
                              },
                              "write": {
                                "type": "number"
                              }
                            },
                            "required": ["read", "write"],
                            "additionalProperties": false
                          }
                        },
                        "required": ["input", "output", "reasoning", "cache"],
                        "additionalProperties": false
                      },
                      "snapshot": {
                        "type": "string"
                      },
                      "files": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "required": ["timestamp", "sessionID", "assistantMessageID", "finish", "cost", "tokens"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.next.step.failed"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "number"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "assistantMessageID": {
                        "type": "string",
                        "pattern": "^msg_"
                      },
                      "error": {
                        "$ref": "#/components/schemas/SessionErrorUnknown"
                      }
                    },
                    "required": ["timestamp", "sessionID", "assistantMessageID", "error"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.next.text.started"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "number"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "assistantMessageID": {
                        "type": "string",
                        "pattern": "^msg_"
                      },
                      "textID": {
                        "type": "string"
                      }
                    },
                    "required": ["timestamp", "sessionID", "assistantMessageID", "textID"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.next.text.delta"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "number"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "assistantMessageID": {
                        "type": "string",
                        "pattern": "^msg_"
                      },
                      "textID": {
                        "type": "string"
                      },
                      "delta": {
                        "type": "string"
                      }
                    },
                    "required": ["timestamp", "sessionID", "assistantMessageID", "textID", "delta"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.next.text.ended"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "number"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "assistantMessageID": {
                        "type": "string",
                        "pattern": "^msg_"
                      },
                      "textID": {
                        "type": "string"
                      },
                      "text": {
                        "type": "string"
                      }
                    },
                    "required": ["timestamp", "sessionID", "assistantMessageID", "textID", "text"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.next.reasoning.started"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "number"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "assistantMessageID": {
                        "type": "string",
                        "pattern": "^msg_"
                      },
                      "reasoningID": {
                        "type": "string"
                      },
                      "providerMetadata": {
                        "$ref": "#/components/schemas/LLMProviderMetadata"
                      }
                    },
                    "required": ["timestamp", "sessionID", "assistantMessageID", "reasoningID"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.next.reasoning.delta"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "number"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "assistantMessageID": {
                        "type": "string",
                        "pattern": "^msg_"
                      },
                      "reasoningID": {
                        "type": "string"
                      },
                      "delta": {
                        "type": "string"
                      }
                    },
                    "required": ["timestamp", "sessionID", "assistantMessageID", "reasoningID", "delta"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.next.reasoning.ended"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "number"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "assistantMessageID": {
                        "type": "string",
                        "pattern": "^msg_"
                      },
                      "reasoningID": {
                        "type": "string"
                      },
                      "text": {
                        "type": "string"
                      },
                      "providerMetadata": {
                        "$ref": "#/components/schemas/LLMProviderMetadata"
                      }
                    },
                    "required": ["timestamp", "sessionID", "assistantMessageID", "reasoningID", "text"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.next.tool.input.started"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "number"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "assistantMessageID": {
                        "type": "string",
                        "pattern": "^msg_"
                      },
                      "callID": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "name"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.next.tool.input.delta"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "number"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "assistantMessageID": {
                        "type": "string",
                        "pattern": "^msg_"
                      },
                      "callID": {
                        "type": "string"
                      },
                      "delta": {
                        "type": "string"
                      }
                    },
                    "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "delta"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.next.tool.input.ended"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "number"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "assistantMessageID": {
                        "type": "string",
                        "pattern": "^msg_"
                      },
                      "callID": {
                        "type": "string"
                      },
                      "text": {
                        "type": "string"
                      }
                    },
                    "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "text"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.next.tool.called"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "number"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "assistantMessageID": {
                        "type": "string",
                        "pattern": "^msg_"
                      },
                      "callID": {
                        "type": "string"
                      },
                      "tool": {
                        "type": "string"
                      },
                      "input": {
                        "type": "object"
                      },
                      "provider": {
                        "type": "object",
                        "properties": {
                          "executed": {
                            "type": "boolean"
                          },
                          "metadata": {
                            "$ref": "#/components/schemas/LLMProviderMetadata"
                          }
                        },
                        "required": ["executed"],
                        "additionalProperties": false
                      }
                    },
                    "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "tool", "input", "provider"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.next.tool.progress"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "number"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "assistantMessageID": {
                        "type": "string",
                        "pattern": "^msg_"
                      },
                      "callID": {
                        "type": "string"
                      },
                      "structured": {
                        "type": "object"
                      },
                      "content": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/LLMToolContent"
                        }
                      }
                    },
                    "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "structured", "content"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.next.tool.success"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "number"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "assistantMessageID": {
                        "type": "string",
                        "pattern": "^msg_"
                      },
                      "callID": {
                        "type": "string"
                      },
                      "structured": {
                        "type": "object"
                      },
                      "content": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/LLMToolContent"
                        }
                      },
                      "outputPaths": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "result": {},
                      "provider": {
                        "type": "object",
                        "properties": {
                          "executed": {
                            "type": "boolean"
                          },
                          "metadata": {
                            "$ref": "#/components/schemas/LLMProviderMetadata"
                          }
                        },
                        "required": ["executed"],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "timestamp",
                      "sessionID",
                      "assistantMessageID",
                      "callID",
                      "structured",
                      "content",
                      "provider"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.next.tool.failed"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "number"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "assistantMessageID": {
                        "type": "string",
                        "pattern": "^msg_"
                      },
                      "callID": {
                        "type": "string"
                      },
                      "error": {
                        "$ref": "#/components/schemas/SessionErrorUnknown"
                      },
                      "result": {},
                      "provider": {
                        "type": "object",
                        "properties": {
                          "executed": {
                            "type": "boolean"
                          },
                          "metadata": {
                            "$ref": "#/components/schemas/LLMProviderMetadata"
                          }
                        },
                        "required": ["executed"],
                        "additionalProperties": false
                      }
                    },
                    "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "error", "provider"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.next.retried"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "number"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "attempt": {
                        "type": "number"
                      },
                      "error": {
                        "$ref": "#/components/schemas/SessionNextRetry_error"
                      }
                    },
                    "required": ["timestamp", "sessionID", "attempt", "error"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.next.compaction.started"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "number"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "messageID": {
                        "type": "string",
                        "pattern": "^msg_"
                      },
                      "reason": {
                        "type": "string",
                        "enum": ["auto", "manual"]
                      }
                    },
                    "required": ["timestamp", "sessionID", "messageID", "reason"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.next.compaction.delta"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "number"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "messageID": {
                        "type": "string",
                        "pattern": "^msg_"
                      },
                      "text": {
                        "type": "string"
                      }
                    },
                    "required": ["timestamp", "sessionID", "messageID", "text"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.next.compaction.ended"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "number"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "messageID": {
                        "type": "string",
                        "pattern": "^msg_"
                      },
                      "reason": {
                        "type": "string",
                        "enum": ["auto", "manual"]
                      },
                      "text": {
                        "type": "string"
                      },
                      "recent": {
                        "type": "string"
                      }
                    },
                    "required": ["timestamp", "sessionID", "messageID", "reason", "text", "recent"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.next.revert.staged"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "number"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "revert": {
                        "$ref": "#/components/schemas/RevertState"
                      }
                    },
                    "required": ["timestamp", "sessionID", "revert"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.next.revert.cleared"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "number"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      }
                    },
                    "required": ["timestamp", "sessionID"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.next.revert.committed"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "number"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "messageID": {
                        "type": "string",
                        "pattern": "^msg_"
                      }
                    },
                    "required": ["timestamp", "sessionID", "messageID"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["message.part.delta"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "messageID": {
                        "type": "string",
                        "pattern": "^msg"
                      },
                      "partID": {
                        "type": "string",
                        "pattern": "^prt"
                      },
                      "field": {
                        "type": "string"
                      },
                      "delta": {
                        "type": "string"
                      }
                    },
                    "required": ["sessionID", "messageID", "partID", "field", "delta"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.diff"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "diff": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/SnapshotFileDiff"
                        }
                      }
                    },
                    "required": ["sessionID", "diff"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.error"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "error": {
                        "anyOf": [
                          {
                            "$ref": "#/components/schemas/ProviderAuthError"
                          },
                          {
                            "$ref": "#/components/schemas/UnknownError"
                          },
                          {
                            "$ref": "#/components/schemas/MessageOutputLengthError"
                          },
                          {
                            "$ref": "#/components/schemas/MessageAbortedError"
                          },
                          {
                            "$ref": "#/components/schemas/StructuredOutputError"
                          },
                          {
                            "$ref": "#/components/schemas/ContextOverflowError"
                          },
                          {
                            "$ref": "#/components/schemas/ContentFilterError"
                          },
                          {
                            "$ref": "#/components/schemas/APIError"
                          }
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["installation.updated"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "version": {
                        "type": "string"
                      }
                    },
                    "required": ["version"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["installation.update-available"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "version": {
                        "type": "string"
                      }
                    },
                    "required": ["version"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["file.edited"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "file": {
                        "type": "string"
                      }
                    },
                    "required": ["file"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["reference.updated"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {}
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["permission.v2.asked"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "^per"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "action": {
                        "type": "string"
                      },
                      "resources": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "save": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "metadata": {
                        "type": "object"
                      },
                      "source": {
                        "$ref": "#/components/schemas/PermissionV2Source"
                      }
                    },
                    "required": ["id", "sessionID", "action", "resources"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["permission.v2.replied"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "requestID": {
                        "type": "string",
                        "pattern": "^per"
                      },
                      "reply": {
                        "$ref": "#/components/schemas/PermissionV2Reply"
                      }
                    },
                    "required": ["sessionID", "requestID", "reply"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["plugin.added"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      }
                    },
                    "required": ["id"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["project.directories.updated"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "projectID": {
                        "type": "string"
                      }
                    },
                    "required": ["projectID"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["file.watcher.updated"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "file": {
                        "type": "string"
                      },
                      "event": {
                        "type": "string",
                        "enum": ["add", "change", "unlink"]
                      }
                    },
                    "required": ["file", "event"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["pty.created"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "info": {
                        "$ref": "#/components/schemas/Pty"
                      }
                    },
                    "required": ["info"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["pty.updated"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "info": {
                        "$ref": "#/components/schemas/Pty"
                      }
                    },
                    "required": ["info"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["pty.exited"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "^pty"
                      },
                      "exitCode": {
                        "type": "integer",
                        "minimum": 0
                      }
                    },
                    "required": ["id", "exitCode"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["pty.deleted"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "^pty"
                      }
                    },
                    "required": ["id"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["question.v2.asked"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "^que"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "questions": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/QuestionV2Info"
                        },
                        "description": "Questions to ask"
                      },
                      "tool": {
                        "$ref": "#/components/schemas/QuestionV2Tool"
                      }
                    },
                    "required": ["id", "sessionID", "questions"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["question.v2.replied"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "requestID": {
                        "type": "string",
                        "pattern": "^que"
                      },
                      "answers": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/QuestionV2Answer"
                        }
                      }
                    },
                    "required": ["sessionID", "requestID", "answers"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["question.v2.rejected"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "requestID": {
                        "type": "string",
                        "pattern": "^que"
                      }
                    },
                    "required": ["sessionID", "requestID"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["lsp.updated"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {}
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["permission.asked"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "^per"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "permission": {
                        "type": "string"
                      },
                      "patterns": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "metadata": {
                        "type": "object"
                      },
                      "always": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "tool": {
                        "type": "object",
                        "properties": {
                          "messageID": {
                            "type": "string"
                          },
                          "callID": {
                            "type": "string"
                          }
                        },
                        "required": ["messageID", "callID"],
                        "additionalProperties": false
                      }
                    },
                    "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["permission.replied"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "requestID": {
                        "type": "string",
                        "pattern": "^per"
                      },
                      "reply": {
                        "type": "string",
                        "enum": ["once", "always", "reject"]
                      }
                    },
                    "required": ["sessionID", "requestID", "reply"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["tui.prompt.append"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "text": {
                        "type": "string"
                      }
                    },
                    "required": ["text"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["tui.command.execute"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "command": {
                        "anyOf": [
                          {
                            "type": "string",
                            "enum": [
                              "session.list",
                              "session.new",
                              "session.share",
                              "session.interrupt",
                              "session.compact",
                              "session.page.up",
                              "session.page.down",
                              "session.line.up",
                              "session.line.down",
                              "session.half.page.up",
                              "session.half.page.down",
                              "session.first",
                              "session.last",
                              "prompt.clear",
                              "prompt.submit",
                              "agent.cycle"
                            ]
                          },
                          {
                            "type": "string"
                          }
                        ]
                      }
                    },
                    "required": ["command"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["tui.toast.show"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "title": {
                        "type": "string"
                      },
                      "message": {
                        "type": "string"
                      },
                      "variant": {
                        "type": "string",
                        "enum": ["info", "success", "warning", "error"]
                      },
                      "duration": {
                        "type": "integer",
                        "exclusiveMinimum": 0
                      }
                    },
                    "required": ["message", "variant"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["tui.session.select"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses",
                        "description": "Session ID to navigate to"
                      }
                    },
                    "required": ["sessionID"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["mcp.tools.changed"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "server": {
                        "type": "string"
                      }
                    },
                    "required": ["server"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["mcp.browser.open.failed"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "mcpName": {
                        "type": "string"
                      },
                      "url": {
                        "type": "string"
                      }
                    },
                    "required": ["mcpName", "url"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["command.executed"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "arguments": {
                        "type": "string"
                      },
                      "messageID": {
                        "type": "string",
                        "pattern": "^msg"
                      }
                    },
                    "required": ["name", "sessionID", "arguments", "messageID"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["project.updated"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "worktree": {
                        "type": "string"
                      },
                      "vcs": {
                        "$ref": "#/components/schemas/ProjectVcs"
                      },
                      "name": {
                        "type": "string"
                      },
                      "icon": {
                        "$ref": "#/components/schemas/ProjectIcon"
                      },
                      "commands": {
                        "$ref": "#/components/schemas/ProjectCommands"
                      },
                      "time": {
                        "$ref": "#/components/schemas/ProjectTime"
                      },
                      "sandboxes": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "required": ["id", "worktree", "time", "sandboxes"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.status"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "status": {
                        "$ref": "#/components/schemas/SessionStatus"
                      }
                    },
                    "required": ["sessionID", "status"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.idle"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      }
                    },
                    "required": ["sessionID"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["question.asked"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "^que"
                      },
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "questions": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/QuestionInfo"
                        },
                        "description": "Questions to ask"
                      },
                      "tool": {
                        "$ref": "#/components/schemas/QuestionTool"
                      }
                    },
                    "required": ["id", "sessionID", "questions"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["question.replied"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "requestID": {
                        "type": "string",
                        "pattern": "^que"
                      },
                      "answers": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/QuestionAnswer"
                        }
                      }
                    },
                    "required": ["sessionID", "requestID", "answers"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["question.rejected"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      },
                      "requestID": {
                        "type": "string",
                        "pattern": "^que"
                      }
                    },
                    "required": ["sessionID", "requestID"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["session.compacted"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "sessionID": {
                        "type": "string",
                        "pattern": "^ses"
                      }
                    },
                    "required": ["sessionID"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["vcs.branch.updated"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "branch": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["workspace.ready"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": ["name"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["workspace.failed"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "message": {
                        "type": "string"
                      }
                    },
                    "required": ["message"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["workspace.status"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "workspaceID": {
                        "type": "string",
                        "pattern": "^wrk"
                      },
                      "status": {
                        "type": "string",
                        "enum": ["connected", "connecting", "disconnected", "error"]
                      }
                    },
                    "required": ["workspaceID", "status"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["worktree.ready"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "branch": {
                        "type": "string"
                      }
                    },
                    "required": ["name"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["worktree.failed"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "message": {
                        "type": "string"
                      }
                    },
                    "required": ["message"],
                    "additionalProperties": false
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["server.connected"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {}
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["global.disposed"]
                  },
                  "properties": {
                    "type": "object",
                    "properties": {}
                  }
                },
                "required": ["id", "type", "properties"],
                "additionalProperties": false
              },
              {
                "$ref": "#/components/schemas/EventServerInstanceDisposed"
              },
              {
                "$ref": "#/components/schemas/SyncEventSessionCreated"
              },
              {
                "$ref": "#/components/schemas/SyncEventSessionUpdated"
              },
              {
                "$ref": "#/components/schemas/SyncEventSessionDeleted"
              },
              {
                "$ref": "#/components/schemas/SyncEventMessageUpdated"
              },
              {
                "$ref": "#/components/schemas/SyncEventMessageRemoved"
              },
              {
                "$ref": "#/components/schemas/SyncEventMessagePartUpdated"
              },
              {
                "$ref": "#/components/schemas/SyncEventMessagePartRemoved"
              },
              {
                "$ref": "#/components/schemas/SyncEventSessionNextAgentSwitched"
              },
              {
                "$ref": "#/components/schemas/SyncEventSessionNextModelSwitched"
              },
              {
                "$ref": "#/components/schemas/SyncEventSessionNextMoved"
              },
              {
                "$ref": "#/components/schemas/SyncEventSessionNextPrompted"
              },
              {
                "$ref": "#/components/schemas/SyncEventSessionNextPromptAdmitted"
              },
              {
                "$ref": "#/components/schemas/SyncEventSessionNextContextUpdated"
              },
              {
                "$ref": "#/components/schemas/SyncEventSessionNextSynthetic"
              },
              {
                "$ref": "#/components/schemas/SyncEventSessionNextShellStarted"
              },
              {
                "$ref": "#/components/schemas/SyncEventSessionNextShellEnded"
              },
              {
                "$ref": "#/components/schemas/SyncEventSessionNextStepStarted"
              },
              {
                "$ref": "#/components/schemas/SyncEventSessionNextStepEnded"
              },
              {
                "$ref": "#/components/schemas/SyncEventSessionNextStepFailed"
              },
              {
                "$ref": "#/components/schemas/SyncEventSessionNextTextStarted"
              },
              {
                "$ref": "#/components/schemas/SyncEventSessionNextTextEnded"
              },
              {
                "$ref": "#/components/schemas/SyncEventSessionNextReasoningStarted"
              },
              {
                "$ref": "#/components/schemas/SyncEventSessionNextReasoningEnded"
              },
              {
                "$ref": "#/components/schemas/SyncEventSessionNextToolInputStarted"
              },
              {
                "$ref": "#/components/schemas/SyncEventSessionNextToolInputEnded"
              },
              {
                "$ref": "#/components/schemas/SyncEventSessionNextToolCalled"
              },
              {
                "$ref": "#/components/schemas/SyncEventSessionNextToolProgress"
              },
              {
                "$ref": "#/components/schemas/SyncEventSessionNextToolSuccess"
              },
              {
                "$ref": "#/components/schemas/SyncEventSessionNextToolFailed"
              },
              {
                "$ref": "#/components/schemas/SyncEventSessionNextRetried"
              },
              {
                "$ref": "#/components/schemas/SyncEventSessionNextCompactionStarted"
              },
              {
                "$ref": "#/components/schemas/SyncEventSessionNextCompactionEnded"
              },
              {
                "$ref": "#/components/schemas/SyncEventSessionNextRevertStaged"
              },
              {
                "$ref": "#/components/schemas/SyncEventSessionNextRevertCleared"
              },
              {
                "$ref": "#/components/schemas/SyncEventSessionNextRevertCommitted"
              }
            ]
          }
        },
        "required": ["directory", "payload"],
        "additionalProperties": false
      },
      "LogLevel": {
        "type": "string",
        "enum": ["DEBUG", "INFO", "WARN", "ERROR"],
        "description": "Log level"
      },
      "ServerConfig": {
        "type": "object",
        "properties": {
          "port": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "hostname": {
            "type": "string"
          },
          "mdns": {
            "type": "boolean"
          },
          "mdnsDomain": {
            "type": "string"
          },
          "cors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false,
        "description": "Server configuration for opencode serve and web commands"
      },
      "PermissionActionConfig": {
        "type": "string",
        "enum": ["ask", "allow", "deny"]
      },
      "PermissionObjectConfig": {
        "type": "object",
        "additionalProperties": {
          "$ref": "#/components/schemas/PermissionActionConfig"
        }
      },
      "PermissionRuleConfig": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/PermissionActionConfig"
          },
          {
            "$ref": "#/components/schemas/PermissionObjectConfig"
          }
        ]
      },
      "PermissionConfig": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/PermissionActionConfig"
          },
          {
            "type": "object",
            "properties": {
              "read": {
                "$ref": "#/components/schemas/PermissionRuleConfig"
              },
              "edit": {
                "$ref": "#/components/schemas/PermissionRuleConfig"
              },
              "glob": {
                "$ref": "#/components/schemas/PermissionRuleConfig"
              },
              "grep": {
                "$ref": "#/components/schemas/PermissionRuleConfig"
              },
              "list": {
                "$ref": "#/components/schemas/PermissionRuleConfig"
              },
              "bash": {
                "$ref": "#/components/schemas/PermissionRuleConfig"
              },
              "task": {
                "$ref": "#/components/schemas/PermissionRuleConfig"
              },
              "external_directory": {
                "$ref": "#/components/schemas/PermissionRuleConfig"
              },
              "question": {
                "$ref": "#/components/schemas/PermissionActionConfig"
              },
              "webfetch": {
                "$ref": "#/components/schemas/PermissionActionConfig"
              },
              "websearch": {
                "$ref": "#/components/schemas/PermissionActionConfig"
              },
              "lsp": {
                "$ref": "#/components/schemas/PermissionRuleConfig"
              },
              "doom_loop": {
                "$ref": "#/components/schemas/PermissionActionConfig"
              },
              "skill": {
                "$ref": "#/components/schemas/PermissionRuleConfig"
              }
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/PermissionRuleConfig"
            }
          }
        ]
      },
      "AgentConfig": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string"
          },
          "variant": {
            "type": "string"
          },
          "temperature": {
            "type": "number"
          },
          "top_p": {
            "type": "number"
          },
          "prompt": {
            "type": "string"
          },
          "tools": {
            "type": "object",
            "additionalProperties": {
              "type": "boolean"
            }
          },
          "disable": {
            "type": "boolean"
          },
          "description": {
            "type": "string"
          },
          "mode": {
            "type": "string",
            "enum": ["subagent", "primary", "all"]
          },
          "hidden": {
            "type": "boolean"
          },
          "options": {
            "type": "object"
          },
          "color": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^#[0-9a-fA-F]{6}$"
              },
              {
                "type": "string",
                "enum": ["primary", "secondary", "accent", "success", "warning", "error", "info"]
              }
            ],
            "description": "Hex color code (e.g., #FF5733) or theme color (e.g., primary)"
          },
          "steps": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "maxSteps": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "permission": {
            "$ref": "#/components/schemas/PermissionConfig"
          }
        },
        "additionalProperties": {}
      },
      "ProviderConfig": {
        "type": "object",
        "properties": {
          "api": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "env": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "id": {
            "type": "string"
          },
          "npm": {
            "type": "string"
          },
          "whitelist": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "blacklist": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "options": {
            "type": "object",
            "properties": {
              "apiKey": {
                "type": "string"
              },
              "baseURL": {
                "type": "string"
              },
              "enterpriseUrl": {
                "type": "string"
              },
              "setCacheKey": {
                "type": "boolean"
              },
              "timeout": {
                "anyOf": [
                  {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  },
                  {
                    "type": "boolean",
                    "enum": [false]
                  }
                ],
                "description": "Timeout in milliseconds for full requests to this provider. Set to false to disable timeout."
              },
              "headerTimeout": {
                "anyOf": [
                  {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  },
                  {
                    "type": "boolean",
                    "enum": [false]
                  }
                ],
                "description": "Timeout in milliseconds to wait for response headers. Provider integrations may set defaults. Set to false to disable timeout."
              },
              "chunkTimeout": {
                "type": "integer",
                "exclusiveMinimum": 0
              }
            },
            "additionalProperties": {}
          },
          "models": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "family": {
                  "type": "string"
                },
                "release_date": {
                  "type": "string"
                },
                "attachment": {
                  "type": "boolean"
                },
                "reasoning": {
                  "type": "boolean"
                },
                "temperature": {
                  "type": "boolean"
                },
                "tool_call": {
                  "type": "boolean"
                },
                "interleaved": {
                  "anyOf": [
                    {
                      "type": "boolean",
                      "enum": [true]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "field": {
                          "type": "string",
                          "enum": ["reasoning", "reasoning_content", "reasoning_details"]
                        }
                      },
                      "required": ["field"],
                      "additionalProperties": false
                    }
                  ]
                },
                "cost": {
                  "type": "object",
                  "properties": {
                    "input": {
                      "type": "number"
                    },
                    "output": {
                      "type": "number"
                    },
                    "cache_read": {
                      "type": "number"
                    },
                    "cache_write": {
                      "type": "number"
                    },
                    "context_over_200k": {
                      "type": "object",
                      "properties": {
                        "input": {
                          "type": "number"
                        },
                        "output": {
                          "type": "number"
                        },
                        "cache_read": {
                          "type": "number"
                        },
                        "cache_write": {
                          "type": "number"
                        }
                      },
                      "required": ["input", "output"],
                      "additionalProperties": false
                    }
                  },
                  "required": ["input", "output"],
                  "additionalProperties": false
                },
                "limit": {
                  "type": "object",
                  "properties": {
                    "context": {
                      "type": "number"
                    },
                    "input": {
                      "type": "number"
                    },
                    "output": {
                      "type": "number"
                    }
                  },
                  "required": ["context", "output"],
                  "additionalProperties": false
                },
                "modalities": {
                  "type": "object",
                  "properties": {
                    "input": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": ["text", "audio", "image", "video", "pdf"]
                      }
                    },
                    "output": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": ["text", "audio", "image", "video", "pdf"]
                      }
                    }
                  },
                  "additionalProperties": false
                },
                "experimental": {
                  "type": "boolean"
                },
                "status": {
                  "type": "string",
                  "enum": ["alpha", "beta", "deprecated", "active"]
                },
                "provider": {
                  "type": "object",
                  "properties": {
                    "npm": {
                      "type": "string"
                    },
                    "api": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                },
                "options": {
                  "type": "object"
                },
                "headers": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                },
                "variants": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "object",
                    "properties": {
                      "disabled": {
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": {}
                  },
                  "description": "Variant-specific configuration"
                }
              },
              "additionalProperties": false
            }
          }
        },
        "additionalProperties": false
      },
      "McpLocalConfig": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["local"],
            "description": "Type of MCP server connection"
          },
          "command": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Command and arguments to run the MCP server"
          },
          "cwd": {
            "type": "string"
          },
          "environment": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "timeout": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": ["type", "command"],
        "additionalProperties": false
      },
      "McpOAuthConfig": {
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string"
          },
          "clientSecret": {
            "type": "string"
          },
          "scope": {
            "type": "string"
          },
          "callbackPort": {
            "type": "integer",
            "minimum": 1,
            "maximum": 65535
          },
          "redirectUri": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "McpRemoteConfig": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["remote"],
            "description": "Type of MCP server connection"
          },
          "url": {
            "type": "string",
            "description": "URL of the remote MCP server"
          },
          "enabled": {
            "type": "boolean"
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "oauth": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/McpOAuthConfig"
              },
              {
                "type": "boolean",
                "enum": [false]
              }
            ],
            "description": "OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection."
          },
          "timeout": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": ["type", "url"],
        "additionalProperties": false
      },
      "LayoutConfig": {
        "type": "string",
        "enum": ["auto", "stretch"],
        "description": "@deprecated Always uses stretch layout."
      },
      "ImageAttachmentConfig": {
        "type": "object",
        "properties": {
          "auto_resize": {
            "type": "boolean"
          },
          "max_width": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "max_height": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "max_base64_bytes": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "additionalProperties": false
      },
      "AttachmentConfig": {
        "type": "object",
        "properties": {
          "image": {
            "$ref": "#/components/schemas/ImageAttachmentConfig"
          }
        },
        "additionalProperties": false
      },
      "Config": {
        "type": "object",
        "properties": {
          "$schema": {
            "type": "string"
          },
          "shell": {
            "type": "string"
          },
          "logLevel": {
            "$ref": "#/components/schemas/LogLevel"
          },
          "server": {
            "$ref": "#/components/schemas/ServerConfig"
          },
          "command": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "template": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "agent": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "variant": {
                  "type": "string"
                },
                "subtask": {
                  "type": "boolean"
                }
              },
              "required": ["template"],
              "additionalProperties": false
            }
          },
          "skills": {
            "type": "object",
            "properties": {
              "paths": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "urls": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "additionalProperties": false
          },
          "references": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "$ref": "#/components/schemas/ConfigV2ReferenceGit"
                },
                {
                  "$ref": "#/components/schemas/ConfigV2ReferenceLocal"
                }
              ]
            }
          },
          "reference": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "$ref": "#/components/schemas/ConfigV2ReferenceGit"
                },
                {
                  "$ref": "#/components/schemas/ConfigV2ReferenceLocal"
                }
              ]
            }
          },
          "watcher": {
            "type": "object",
            "properties": {
              "ignore": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "additionalProperties": false
          },
          "snapshot": {
            "type": "boolean"
          },
          "plugin": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "object"
                    }
                  ],
                  "maxItems": 2,
                  "minItems": 2
                }
              ]
            }
          },
          "share": {
            "type": "string",
            "enum": ["manual", "auto", "disabled"]
          },
          "autoshare": {
            "type": "boolean"
          },
          "autoupdate": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "string",
                "enum": ["notify"]
              }
            ],
            "description": "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications"
          },
          "disabled_providers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "enabled_providers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "model": {
            "type": "string"
          },
          "small_model": {
            "type": "string"
          },
          "default_agent": {
            "type": "string"
          },
          "subagent_depth": {
            "type": "integer",
            "minimum": 0
          },
          "username": {
            "type": "string"
          },
          "mode": {
            "type": "object",
            "properties": {
              "build": {
                "$ref": "#/components/schemas/AgentConfig"
              },
              "plan": {
                "$ref": "#/components/schemas/AgentConfig"
              }
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/AgentConfig"
            }
          },
          "agent": {
            "type": "object",
            "properties": {
              "plan": {
                "$ref": "#/components/schemas/AgentConfig"
              },
              "build": {
                "$ref": "#/components/schemas/AgentConfig"
              },
              "general": {
                "$ref": "#/components/schemas/AgentConfig"
              },
              "explore": {
                "$ref": "#/components/schemas/AgentConfig"
              },
              "title": {
                "$ref": "#/components/schemas/AgentConfig"
              },
              "summary": {
                "$ref": "#/components/schemas/AgentConfig"
              },
              "compaction": {
                "$ref": "#/components/schemas/AgentConfig"
              }
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/AgentConfig"
            }
          },
          "provider": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/ProviderConfig"
            }
          },
          "mcp": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/McpLocalConfig"
                },
                {
                  "$ref": "#/components/schemas/McpRemoteConfig"
                },
                {
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "boolean"
                    }
                  },
                  "required": ["enabled"],
                  "additionalProperties": false
                }
              ]
            }
          },
          "formatter": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "object",
                "additionalProperties": {
                  "type": "object",
                  "properties": {
                    "disabled": {
                      "type": "boolean"
                    },
                    "command": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "environment": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      }
                    },
                    "extensions": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            ],
            "description": "Enable or configure formatters. Omit or set to false to disable, true to enable built-ins, or an object to enable built-ins with overrides."
          },
          "lsp": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "object",
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "disabled": {
                          "type": "boolean",
                          "enum": [true]
                        }
                      },
                      "required": ["disabled"],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "command": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "extensions": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "disabled": {
                          "type": "boolean"
                        },
                        "env": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "string"
                          }
                        },
                        "initialization": {
                          "type": "object"
                        }
                      },
                      "required": ["command"],
                      "additionalProperties": false
                    }
                  ]
                }
              }
            ],
            "description": "Enable or configure LSP servers. Omit or set to false to disable, true to enable built-ins, or an object to enable built-ins with overrides."
          },
          "instructions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "layout": {
            "$ref": "#/components/schemas/LayoutConfig"
          },
          "permission": {
            "$ref": "#/components/schemas/PermissionConfig"
          },
          "tools": {
            "type": "object",
            "additionalProperties": {
              "type": "boolean"
            }
          },
          "attachment": {
            "$ref": "#/components/schemas/AttachmentConfig"
          },
          "enterprise": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string"
              }
            },
            "additionalProperties": false
          },
          "tool_output": {
            "type": "object",
            "properties": {
              "max_lines": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "max_bytes": {
                "type": "integer",
                "exclusiveMinimum": 0
              }
            },
            "additionalProperties": false
          },
          "compaction": {
            "type": "object",
            "properties": {
              "auto": {
                "type": "boolean"
              },
              "prune": {
                "type": "boolean"
              },
              "tail_turns": {
                "type": "integer",
                "minimum": 0
              },
              "preserve_recent_tokens": {
                "type": "integer",
                "minimum": 0
              },
              "reserved": {
                "type": "integer",
                "minimum": 0
              }
            },
            "additionalProperties": false
          },
          "experimental": {
            "type": "object",
            "properties": {
              "disable_paste_summary": {
                "type": "boolean"
              },
              "batch_tool": {
                "type": "boolean"
              },
              "openTelemetry": {
                "type": "boolean"
              },
              "primary_tools": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "continue_loop_on_deny": {
                "type": "boolean"
              },
              "mcp_timeout": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "policies": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ConfigV2ExperimentalPolicy"
                }
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "Model": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "providerID": {
            "type": "string"
          },
          "api": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string"
              },
              "npm": {
                "type": "string"
              }
            },
            "required": ["id", "url", "npm"],
            "additionalProperties": false
          },
          "name": {
            "type": "string"
          },
          "family": {
            "type": "string"
          },
          "capabilities": {
            "type": "object",
            "properties": {
              "temperature": {
                "type": "boolean"
              },
              "reasoning": {
                "type": "boolean"
              },
              "attachment": {
                "type": "boolean"
              },
              "toolcall": {
                "type": "boolean"
              },
              "input": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "boolean"
                  },
                  "audio": {
                    "type": "boolean"
                  },
                  "image": {
                    "type": "boolean"
                  },
                  "video": {
                    "type": "boolean"
                  },
                  "pdf": {
                    "type": "boolean"
                  }
                },
                "required": ["text", "audio", "image", "video", "pdf"],
                "additionalProperties": false
              },
              "output": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "boolean"
                  },
                  "audio": {
                    "type": "boolean"
                  },
                  "image": {
                    "type": "boolean"
                  },
                  "video": {
                    "type": "boolean"
                  },
                  "pdf": {
                    "type": "boolean"
                  }
                },
                "required": ["text", "audio", "image", "video", "pdf"],
                "additionalProperties": false
              },
              "interleaved": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "field": {
                        "type": "string",
                        "enum": ["reasoning", "reasoning_content", "reasoning_details"]
                      }
                    },
                    "required": ["field"],
                    "additionalProperties": false
                  }
                ]
              }
            },
            "required": ["temperature", "reasoning", "attachment", "toolcall", "input", "output", "interleaved"],
            "additionalProperties": false
          },
          "cost": {
            "type": "object",
            "properties": {
              "input": {
                "type": "number"
              },
              "output": {
                "type": "number"
              },
              "cache": {
                "type": "object",
                "properties": {
                  "read": {
                    "type": "number"
                  },
                  "write": {
                    "type": "number"
                  }
                },
                "required": ["read", "write"],
                "additionalProperties": false
              },
              "tiers": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "input": {
                      "type": "number"
                    },
                    "output": {
                      "type": "number"
                    },
                    "cache": {
                      "type": "object",
                      "properties": {
                        "read": {
                          "type": "number"
                        },
                        "write": {
                          "type": "number"
                        }
                      },
                      "required": ["read", "write"],
                      "additionalProperties": false
                    },
                    "tier": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": ["context"]
                        },
                        "size": {
                          "type": "number"
                        }
                      },
                      "required": ["type", "size"],
                      "additionalProperties": false
                    }
                  },
                  "required": ["input", "output", "cache", "tier"],
                  "additionalProperties": false
                }
              },
              "experimentalOver200K": {
                "type": "object",
                "properties": {
                  "input": {
                    "type": "number"
                  },
                  "output": {
                    "type": "number"
                  },
                  "cache": {
                    "type": "object",
                    "properties": {
                      "read": {
                        "type": "number"
                      },
                      "write": {
                        "type": "number"
                      }
                    },
                    "required": ["read", "write"],
                    "additionalProperties": false
                  }
                },
                "required": ["input", "output", "cache"],
                "additionalProperties": false
              }
            },
            "required": ["input", "output", "cache"],
            "additionalProperties": false
          },
          "limit": {
            "type": "object",
            "properties": {
              "context": {
                "type": "number"
              },
              "input": {
                "type": "number"
              },
              "output": {
                "type": "number"
              }
            },
            "required": ["context", "output"],
            "additionalProperties": false
          },
          "status": {
            "type": "string",
            "enum": ["alpha", "beta", "deprecated", "active"]
          },
          "options": {
            "type": "object"
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "release_date": {
            "type": "string"
          },
          "variants": {
            "type": "object",
            "additionalProperties": {
              "type": "object"
            }
          }
        },
        "required": [
          "id",
          "providerID",
          "api",
          "name",
          "capabilities",
          "cost",
          "limit",
          "status",
          "options",
          "headers",
          "release_date"
        ],
        "additionalProperties": false
      },
      "Provider": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "enum": ["env", "config", "custom", "api"]
          },
          "env": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "key": {
            "type": "string"
          },
          "options": {
            "type": "object"
          },
          "models": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Model"
            }
          }
        },
        "required": ["id", "name", "source", "env", "options", "models"],
        "additionalProperties": false
      },
      "ExperimentalCapabilities": {
        "type": "object",
        "properties": {
          "backgroundSubagents": {
            "type": "boolean"
          }
        },
        "required": ["backgroundSubagents"],
        "additionalProperties": false
      },
      "ConsoleState": {
        "type": "object",
        "properties": {
          "consoleManagedProviders": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "activeOrgName": {
            "type": "string"
          },
          "switchableOrgCount": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": ["consoleManagedProviders", "switchableOrgCount"],
        "additionalProperties": false
      },
      "effect_HttpApiError_InternalServerError": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": ["InternalServerError"]
          }
        },
        "required": ["_tag"],
        "additionalProperties": false
      },
      "ToolListItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "parameters": {}
        },
        "required": ["id", "description", "parameters"],
        "additionalProperties": false
      },
      "ToolList": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/ToolListItem"
        }
      },
      "ToolIDs": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "WorktreeError": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "WorktreeNotGitError",
              "WorktreeNameGenerationFailedError",
              "WorktreeCreateFailedError",
              "WorktreeStartCommandFailedError",
              "WorktreeRemoveFailedError",
              "WorktreeResetFailedError",
              "WorktreeListFailedError"
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              }
            },
            "required": ["message"],
            "additionalProperties": false
          }
        },
        "required": ["name", "data"],
        "additionalProperties": false
      },
      "WorktreeCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "startCommand": {
            "type": "string",
            "description": "Additional startup script to run after the project's start command"
          }
        },
        "additionalProperties": false
      },
      "Worktree": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "branch": {
            "type": "string"
          },
          "directory": {
            "type": "string"
          }
        },
        "required": ["name", "directory"],
        "additionalProperties": false
      },
      "WorktreeRemoveInput": {
        "type": "object",
        "properties": {
          "directory": {
            "type": "string"
          }
        },
        "required": ["directory"],
        "additionalProperties": false
      },
      "WorktreeResetInput": {
        "type": "object",
        "properties": {
          "directory": {
            "type": "string"
          }
        },
        "required": ["directory"],
        "additionalProperties": false
      },
      "ProjectSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "worktree": {
            "type": "string"
          }
        },
        "required": ["id", "worktree"],
        "additionalProperties": false
      },
      "GlobalSession": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^ses"
          },
          "slug": {
            "type": "string"
          },
          "projectID": {
            "type": "string"
          },
          "workspaceID": {
            "type": "string",
            "pattern": "^wrk"
          },
          "directory": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "parentID": {
            "type": "string",
            "pattern": "^ses"
          },
          "summary": {
            "type": "object",
            "properties": {
              "additions": {
                "type": "number"
              },
              "deletions": {
                "type": "number"
              },
              "files": {
                "type": "number"
              },
              "diffs": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SnapshotFileDiff"
                }
              }
            },
            "required": ["additions", "deletions", "files"],
            "additionalProperties": false
          },
          "cost": {
            "type": "number"
          },
          "tokens": {
            "type": "object",
            "properties": {
              "input": {
                "type": "number"
              },
              "output": {
                "type": "number"
              },
              "reasoning": {
                "type": "number"
              },
              "cache": {
                "type": "object",
                "properties": {
                  "read": {
                    "type": "number"
                  },
                  "write": {
                    "type": "number"
                  }
                },
                "required": ["read", "write"],
                "additionalProperties": false
              }
            },
            "required": ["input", "output", "reasoning", "cache"],
            "additionalProperties": false
          },
          "share": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string"
              }
            },
            "required": ["url"],
            "additionalProperties": false
          },
          "title": {
            "type": "string"
          },
          "agent": {
            "type": "string"
          },
          "model": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "providerID": {
                "type": "string"
              },
              "variant": {
                "type": "string"
              }
            },
            "required": ["id", "providerID"],
            "additionalProperties": false
          },
          "version": {
            "type": "string"
          },
          "metadata": {
            "type": "object"
          },
          "time": {
            "type": "object",
            "properties": {
              "created": {
                "type": "integer",
                "minimum": 0
              },
              "updated": {
                "type": "integer",
                "minimum": 0
              },
              "compacting": {
                "type": "integer",
                "minimum": 0
              },
              "archived": {
                "type": "number"
              }
            },
            "required": ["created", "updated"],
            "additionalProperties": false
          },
          "permission": {
            "$ref": "#/components/schemas/PermissionRuleset"
          },
          "revert": {
            "type": "object",
            "properties": {
              "messageID": {
                "type": "string",
                "pattern": "^msg"
              },
              "partID": {
                "type": "string",
                "pattern": "^prt"
              },
              "snapshot": {
                "type": "string"
              },
              "diff": {
                "type": "string"
              }
            },
            "required": ["messageID"],
            "additionalProperties": false
          },
          "project": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ProjectSummary"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["id", "slug", "projectID", "directory", "title", "version", "time", "project"],
        "additionalProperties": false
      },
      "McpResource": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "uri": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "mimeType": {
            "type": "string"
          },
          "client": {
            "type": "string"
          }
        },
        "required": ["name", "uri", "client"],
        "additionalProperties": false
      },
      "Symbol": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "integer",
            "minimum": 0
          },
          "location": {
            "type": "object",
            "properties": {
              "uri": {
                "type": "string"
              },
              "range": {
                "$ref": "#/components/schemas/Range"
              }
            },
            "required": ["uri", "range"],
            "additionalProperties": false
          }
        },
        "required": ["name", "kind", "location"],
        "additionalProperties": false
      },
      "FileNode": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "absolute": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": ["file", "directory"]
          },
          "ignored": {
            "type": "boolean"
          }
        },
        "required": ["name", "path", "absolute", "type", "ignored"],
        "additionalProperties": false
      },
      "FileContent": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["text", "binary"]
          },
          "content": {
            "type": "string"
          },
          "diff": {
            "type": "string"
          },
          "patch": {
            "type": "object",
            "properties": {
              "oldFileName": {
                "type": "string"
              },
              "newFileName": {
                "type": "string"
              },
              "oldHeader": {
                "type": "string"
              },
              "newHeader": {
                "type": "string"
              },
              "hunks": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "oldStart": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "oldLines": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "newStart": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "newLines": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "lines": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": ["oldStart", "oldLines", "newStart", "newLines", "lines"],
                  "additionalProperties": false
                }
              },
              "index": {
                "type": "string"
              }
            },
            "required": ["oldFileName", "newFileName", "hunks"],
            "additionalProperties": false
          },
          "encoding": {
            "type": "string",
            "enum": ["base64"]
          },
          "mimeType": {
            "type": "string"
          }
        },
        "required": ["type", "content"],
        "additionalProperties": false
      },
      "File": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string"
          },
          "added": {
            "type": "integer",
            "minimum": 0
          },
          "removed": {
            "type": "integer",
            "minimum": 0
          },
          "status": {
            "type": "string",
            "enum": ["added", "deleted", "modified"]
          }
        },
        "required": ["path", "added", "removed", "status"],
        "additionalProperties": false
      },
      "Path": {
        "type": "object",
        "properties": {
          "home": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "config": {
            "type": "string"
          },
          "worktree": {
            "type": "string"
          },
          "directory": {
            "type": "string"
          }
        },
        "required": ["home", "state", "config", "worktree", "directory"],
        "additionalProperties": false
      },
      "VcsInfo": {
        "type": "object",
        "properties": {
          "branch": {
            "type": "string"
          },
          "default_branch": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "VcsFileStatus": {
        "type": "object",
        "properties": {
          "file": {
            "type": "string"
          },
          "additions": {
            "type": "number"
          },
          "deletions": {
            "type": "number"
          },
          "status": {
            "type": "string",
            "enum": ["added", "deleted", "modified"]
          }
        },
        "required": ["file", "additions", "deletions", "status"],
        "additionalProperties": false
      },
      "VcsFileDiff": {
        "type": "object",
        "properties": {
          "file": {
            "type": "string"
          },
          "patch": {
            "type": "string"
          },
          "additions": {
            "type": "number"
          },
          "deletions": {
            "type": "number"
          },
          "status": {
            "type": "string",
            "enum": ["added", "deleted", "modified"]
          }
        },
        "required": ["file", "additions", "deletions"],
        "additionalProperties": false
      },
      "VcsApplyError": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": ["VcsApplyError"]
          },
          "data": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              },
              "reason": {
                "type": "string",
                "enum": ["non-git", "not-clean"]
              }
            },
            "required": ["message", "reason"],
            "additionalProperties": false
          }
        },
        "required": ["name", "data"],
        "additionalProperties": false
      },
      "Command": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "agent": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "enum": ["command", "mcp", "skill"]
          },
          "template": {
            "type": "string"
          },
          "subtask": {
            "type": "boolean"
          },
          "hints": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": ["name", "template", "hints"],
        "additionalProperties": false
      },
      "Agent": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "mode": {
            "type": "string",
            "enum": ["subagent", "primary", "all"]
          },
          "native": {
            "type": "boolean"
          },
          "hidden": {
            "type": "boolean"
          },
          "topP": {
            "type": "number"
          },
          "temperature": {
            "type": "number"
          },
          "color": {
            "type": "string"
          },
          "permission": {
            "$ref": "#/components/schemas/PermissionRuleset"
          },
          "model": {
            "type": "object",
            "properties": {
              "modelID": {
                "type": "string"
              },
              "providerID": {
                "type": "string"
              }
            },
            "required": ["modelID", "providerID"],
            "additionalProperties": false
          },
          "variant": {
            "type": "string"
          },
          "prompt": {
            "type": "string"
          },
          "options": {
            "type": "object"
          },
          "steps": {
            "type": "number"
          }
        },
        "required": ["name", "mode", "permission", "options"],
        "additionalProperties": false
      },
      "LSPStatus": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "root": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": ["connected", "error"]
          }
        },
        "required": ["id", "name", "root", "status"],
        "additionalProperties": false
      },
      "FormatterStatus": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "extensions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "enabled": {
            "type": "boolean"
          }
        },
        "required": ["name", "extensions", "enabled"],
        "additionalProperties": false
      },
      "MCPStatusConnected": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": ["connected"]
          }
        },
        "required": ["status"],
        "additionalProperties": false
      },
      "MCPStatusDisabled": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": ["disabled"]
          }
        },
        "required": ["status"],
        "additionalProperties": false
      },
      "MCPStatusFailed": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": ["failed"]
          },
          "error": {
            "type": "string"
          }
        },
        "required": ["status", "error"],
        "additionalProperties": false
      },
      "MCPStatusNeedsAuth": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": ["needs_auth"]
          }
        },
        "required": ["status"],
        "additionalProperties": false
      },
      "MCPStatusNeedsClientRegistration": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": ["needs_client_registration"]
          },
          "error": {
            "type": "string"
          }
        },
        "required": ["status", "error"],
        "additionalProperties": false
      },
      "MCPStatus": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/MCPStatusConnected"
          },
          {
            "$ref": "#/components/schemas/MCPStatusDisabled"
          },
          {
            "$ref": "#/components/schemas/MCPStatusFailed"
          },
          {
            "$ref": "#/components/schemas/MCPStatusNeedsAuth"
          },
          {
            "$ref": "#/components/schemas/MCPStatusNeedsClientRegistration"
          }
        ]
      },
      "McpUnsupportedOAuthError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        },
        "required": ["error"],
        "additionalProperties": false
      },
      "McpServerNotFoundError": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": ["McpServerNotFoundError"]
          },
          "name": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": ["_tag", "name", "message"],
        "additionalProperties": false
      },
      "Project": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "worktree": {
            "type": "string"
          },
          "vcs": {
            "$ref": "#/components/schemas/ProjectVcs"
          },
          "name": {
            "type": "string"
          },
          "icon": {
            "$ref": "#/components/schemas/ProjectIcon"
          },
          "commands": {
            "$ref": "#/components/schemas/ProjectCommands"
          },
          "time": {
            "$ref": "#/components/schemas/ProjectTime"
          },
          "sandboxes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": ["id", "worktree", "time", "sandboxes"],
        "additionalProperties": false
      },
      "ProjectNotFoundError": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": ["ProjectNotFoundError"]
          },
          "projectID": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": ["_tag", "projectID", "message"],
        "additionalProperties": false
      },
      "PtyNotFoundError": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": ["PtyNotFoundError"]
          },
          "ptyID": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": ["_tag", "ptyID", "message"],
        "additionalProperties": false
      },
      "PtyForbiddenError": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": ["PtyForbiddenError"]
          },
          "message": {
            "type": "string"
          }
        },
        "required": ["_tag", "message"],
        "additionalProperties": false
      },
      "QuestionRequest": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^que"
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses"
          },
          "questions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuestionInfo"
            },
            "description": "Questions to ask"
          },
          "tool": {
            "$ref": "#/components/schemas/QuestionTool"
          }
        },
        "required": ["id", "sessionID", "questions"],
        "additionalProperties": false
      },
      "QuestionNotFoundError": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": ["QuestionNotFoundError"]
          },
          "requestID": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": ["_tag", "requestID", "message"],
        "additionalProperties": false
      },
      "PermissionRequest": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^per"
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses"
          },
          "permission": {
            "type": "string"
          },
          "patterns": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "metadata": {
            "type": "object"
          },
          "always": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tool": {
            "type": "object",
            "properties": {
              "messageID": {
                "type": "string"
              },
              "callID": {
                "type": "string"
              }
            },
            "required": ["messageID", "callID"],
            "additionalProperties": false
          }
        },
        "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"],
        "additionalProperties": false
      },
      "PermissionNotFoundError": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": ["PermissionNotFoundError"]
          },
          "requestID": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": ["_tag", "requestID", "message"],
        "additionalProperties": false
      },
      "ProviderAuthMethod": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["oauth", "api"]
          },
          "label": {
            "type": "string"
          },
          "prompts": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": ["text"]
                    },
                    "key": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "placeholder": {
                      "type": "string"
                    },
                    "when": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "op": {
                          "type": "string",
                          "enum": ["eq", "neq"]
                        },
                        "value": {
                          "type": "string"
                        }
                      },
                      "required": ["key", "op", "value"],
                      "additionalProperties": false
                    }
                  },
                  "required": ["type", "key", "message"],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": ["select"]
                    },
                    "key": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "options": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string"
                          },
                          "hint": {
                            "type": "string"
                          }
                        },
                        "required": ["label", "value"],
                        "additionalProperties": false
                      }
                    },
                    "when": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "op": {
                          "type": "string",
                          "enum": ["eq", "neq"]
                        },
                        "value": {
                          "type": "string"
                        }
                      },
                      "required": ["key", "op", "value"],
                      "additionalProperties": false
                    }
                  },
                  "required": ["type", "key", "message", "options"],
                  "additionalProperties": false
                }
              ]
            }
          }
        },
        "required": ["type", "label"],
        "additionalProperties": false
      },
      "ProviderAuthAuthorization": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "method": {
            "type": "string",
            "enum": ["auto", "code"]
          },
          "instructions": {
            "type": "string"
          }
        },
        "required": ["url", "method", "instructions"],
        "additionalProperties": false
      },
      "ProviderAuthError1": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "BadRequest",
              "ProviderAuthOauthMissing",
              "ProviderAuthOauthCodeMissing",
              "ProviderAuthOauthCallbackFailed",
              "ProviderAuthValidationFailed"
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "providerID": {
                "type": "string"
              },
              "field": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "kind": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        "required": ["name", "data"],
        "additionalProperties": false
      },
      "NotFoundError": {
        "type": "object",
        "required": ["name", "data"],
        "properties": {
          "name": {
            "type": "string",
            "enum": ["NotFoundError"]
          },
          "data": {
            "type": "object",
            "required": ["message"],
            "properties": {
              "message": {
                "type": "string"
              }
            }
          }
        }
      },
      "TextPartInput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prt"
          },
          "type": {
            "type": "string",
            "enum": ["text"]
          },
          "text": {
            "type": "string"
          },
          "session.synthetic": {
            "type": "boolean"
          },
          "ignored": {
            "type": "boolean"
          },
          "time": {
            "type": "object",
            "properties": {
              "start": {
                "type": "integer",
                "minimum": 0
              },
              "end": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": ["start"],
            "additionalProperties": false
          },
          "metadata": {
            "type": "object"
          }
        },
        "required": ["type", "text"],
        "additionalProperties": false
      },
      "FilePartInput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prt"
          },
          "type": {
            "type": "string",
            "enum": ["file"]
          },
          "mime": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "source": {
            "$ref": "#/components/schemas/FilePartSource"
          }
        },
        "required": ["type", "mime", "url"],
        "additionalProperties": false
      },
      "AgentPartInput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prt"
          },
          "type": {
            "type": "string",
            "enum": ["agent"]
          },
          "name": {
            "type": "string"
          },
          "source": {
            "type": "object",
            "properties": {
              "value": {
                "type": "string"
              },
              "start": {
                "type": "integer",
                "minimum": 0
              },
              "end": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": ["value", "start", "end"],
            "additionalProperties": false
          }
        },
        "required": ["type", "name"],
        "additionalProperties": false
      },
      "SubtaskPartInput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prt"
          },
          "type": {
            "type": "string",
            "enum": ["subtask"]
          },
          "prompt": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "agent": {
            "type": "string"
          },
          "model": {
            "type": "object",
            "properties": {
              "providerID": {
                "type": "string"
              },
              "modelID": {
                "type": "string"
              }
            },
            "required": ["providerID", "modelID"],
            "additionalProperties": false
          },
          "command": {
            "type": "string"
          }
        },
        "required": ["type", "prompt", "description", "agent"],
        "additionalProperties": false
      },
      "SessionBusyError": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": ["SessionBusyError"]
          },
          "sessionID": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": ["_tag", "sessionID", "message"],
        "additionalProperties": false
      },
      "EventTuiPromptAppend": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["tui.prompt.append"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              }
            },
            "required": ["text"],
            "additionalProperties": false
          }
        },
        "required": ["type", "properties"],
        "additionalProperties": false
      },
      "EventTuiCommandExecute": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["tui.command.execute"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "command": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "session.list",
                      "session.new",
                      "session.share",
                      "session.interrupt",
                      "session.compact",
                      "session.page.up",
                      "session.page.down",
                      "session.line.up",
                      "session.line.down",
                      "session.half.page.up",
                      "session.half.page.down",
                      "session.first",
                      "session.last",
                      "prompt.clear",
                      "prompt.submit",
                      "agent.cycle"
                    ]
                  },
                  {
                    "type": "string"
                  }
                ]
              }
            },
            "required": ["command"],
            "additionalProperties": false
          }
        },
        "required": ["type", "properties"],
        "additionalProperties": false
      },
      "EventTuiToastShow": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["tui.toast.show"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "title": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "variant": {
                "type": "string",
                "enum": ["info", "success", "warning", "error"]
              },
              "duration": {
                "type": "integer",
                "exclusiveMinimum": 0
              }
            },
            "required": ["message", "variant"],
            "additionalProperties": false
          }
        },
        "required": ["type", "properties"],
        "additionalProperties": false
      },
      "EventTuiSessionSelect": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["tui.session.select"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses",
                "description": "Session ID to navigate to"
              }
            },
            "required": ["sessionID"],
            "additionalProperties": false
          }
        },
        "required": ["type", "properties"],
        "additionalProperties": false
      },
      "Workspace": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^wrk"
          },
          "type": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "branch": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "directory": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "extra": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ]
          },
          "projectID": {
            "type": "string"
          },
          "timeUsed": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "enum": ["NaN"]
              },
              {
                "type": "string",
                "enum": ["Infinity"]
              },
              {
                "type": "string",
                "enum": ["-Infinity"]
              },
              {
                "type": "string",
                "enum": ["Infinity", "-Infinity", "NaN"]
              }
            ]
          }
        },
        "required": ["id", "type", "name", "projectID", "timeUsed"],
        "additionalProperties": false
      },
      "WorkspaceCreateError": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": ["WorkspaceCreateError"]
          },
          "data": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              }
            },
            "required": ["message"],
            "additionalProperties": false
          }
        },
        "required": ["name", "data"],
        "additionalProperties": false
      },
      "WorkspaceWarpError": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": ["WorkspaceWarpError"]
          },
          "data": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              }
            },
            "required": ["message"],
            "additionalProperties": false
          }
        },
        "required": ["name", "data"],
        "additionalProperties": false
      },
      "UnauthorizedError": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": ["UnauthorizedError"]
          },
          "message": {
            "type": "string"
          }
        },
        "required": ["_tag", "message"],
        "additionalProperties": false
      },
      "SessionsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SessionV2Info"
            }
          },
          "cursor": {
            "type": "object",
            "properties": {
              "previous": {
                "type": "string"
              },
              "next": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        "required": ["data", "cursor"],
        "additionalProperties": false
      },
      "InvalidCursorError": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": ["InvalidCursorError"]
          },
          "message": {
            "type": "string"
          }
        },
        "required": ["_tag", "message"],
        "additionalProperties": false
      },
      "SessionActive": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["running"]
          }
        },
        "required": ["type"],
        "additionalProperties": false
      },
      "SessionNotFoundError": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": ["SessionNotFoundError"]
          },
          "sessionID": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": ["_tag", "sessionID", "message"],
        "additionalProperties": false
      },
      "PromptInput": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PromptInputFileAttachment"
            }
          },
          "agents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PromptAgentAttachment"
            }
          }
        },
        "required": ["text"],
        "additionalProperties": false
      },
      "ConflictError": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": ["ConflictError"]
          },
          "message": {
            "type": "string"
          },
          "resource": {
            "type": "string"
          }
        },
        "required": ["_tag", "message"],
        "additionalProperties": false
      },
      "ServiceUnavailableError": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": ["ServiceUnavailableError"]
          },
          "message": {
            "type": "string"
          },
          "service": {
            "type": "string"
          }
        },
        "required": ["_tag", "message"],
        "additionalProperties": false
      },
      "MessageNotFoundError": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": ["MessageNotFoundError"]
          },
          "sessionID": {
            "type": "string"
          },
          "messageID": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": ["_tag", "sessionID", "messageID", "message"],
        "additionalProperties": false
      },
      "UnknownError1": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": ["UnknownError"]
          },
          "message": {
            "type": "string"
          },
          "ref": {
            "type": "string"
          }
        },
        "required": ["_tag", "message"],
        "additionalProperties": false
      },
      "SessionDurableEvent": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/SessionNextAgentSwitched"
          },
          {
            "$ref": "#/components/schemas/SessionNextModelSwitched"
          },
          {
            "$ref": "#/components/schemas/SessionNextMoved"
          },
          {
            "$ref": "#/components/schemas/SessionNextPrompted"
          },
          {
            "$ref": "#/components/schemas/SessionNextPromptAdmitted"
          },
          {
            "$ref": "#/components/schemas/SessionNextContextUpdated"
          },
          {
            "$ref": "#/components/schemas/SessionNextSynthetic"
          },
          {
            "$ref": "#/components/schemas/SessionNextShellStarted"
          },
          {
            "$ref": "#/components/schemas/SessionNextShellEnded"
          },
          {
            "$ref": "#/components/schemas/SessionNextStepStarted"
          },
          {
            "$ref": "#/components/schemas/SessionNextStepEnded"
          },
          {
            "$ref": "#/components/schemas/SessionNextStepFailed"
          },
          {
            "$ref": "#/components/schemas/SessionNextTextStarted"
          },
          {
            "$ref": "#/components/schemas/SessionNextTextEnded"
          },
          {
            "$ref": "#/components/schemas/SessionNextToolInputStarted"
          },
          {
            "$ref": "#/components/schemas/SessionNextToolInputEnded"
          },
          {
            "$ref": "#/components/schemas/SessionNextToolCalled"
          },
          {
            "$ref": "#/components/schemas/SessionNextToolProgress"
          },
          {
            "$ref": "#/components/schemas/SessionNextToolSuccess"
          },
          {
            "$ref": "#/components/schemas/SessionNextToolFailed"
          },
          {
            "$ref": "#/components/schemas/SessionNextReasoningStarted"
          },
          {
            "$ref": "#/components/schemas/SessionNextReasoningEnded"
          },
          {
            "$ref": "#/components/schemas/SessionNextRetried"
          },
          {
            "$ref": "#/components/schemas/SessionNextCompactionStarted"
          },
          {
            "$ref": "#/components/schemas/SessionNextCompactionEnded"
          },
          {
            "$ref": "#/components/schemas/SessionNextRevertStaged"
          },
          {
            "$ref": "#/components/schemas/SessionNextRevertCleared"
          },
          {
            "$ref": "#/components/schemas/SessionNextRevertCommitted"
          }
        ]
      },
      "SessionHistory": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SessionDurableEvent"
            }
          },
          "hasMore": {
            "type": "boolean"
          }
        },
        "required": ["data", "hasMore"],
        "additionalProperties": false
      },
      "SessionDurableEventStream": {
        "type": "string",
        "contentSchema": {
          "$ref": "#/components/schemas/SessionDurableEvent"
        },
        "contentMediaType": "application/json"
      },
      "SessionMessagesResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SessionMessage"
            }
          },
          "cursor": {
            "type": "object",
            "properties": {
              "previous": {
                "type": "string"
              },
              "next": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        "required": ["data", "cursor"],
        "additionalProperties": false
      },
      "ProviderNotFoundError": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": ["ProviderNotFoundError"]
          },
          "providerID": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": ["_tag", "providerID", "message"],
        "additionalProperties": false
      },
      "OutputFormat1": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["text"]
              }
            },
            "required": ["type"],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["json_schema"]
              },
              "schema": {
                "$ref": "#/components/schemas/JSONSchema"
              },
              "retryCount": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": ["type", "schema"],
            "additionalProperties": false
          }
        ]
      },
      "session.status": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.status"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "status": {
                "$ref": "#/components/schemas/SessionStatus"
              }
            },
            "required": ["sessionID", "status"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "question.replied": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["question.replied"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "requestID": {
                "type": "string",
                "pattern": "^que"
              },
              "answers": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/QuestionAnswer"
                }
              }
            },
            "required": ["sessionID", "requestID", "answers"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "question.rejected": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["question.rejected"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "requestID": {
                "type": "string",
                "pattern": "^que"
              }
            },
            "required": ["sessionID", "requestID"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "V2Event": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/Models-devRefreshed"
          },
          {
            "$ref": "#/components/schemas/IntegrationUpdated"
          },
          {
            "$ref": "#/components/schemas/IntegrationConnectionUpdated"
          },
          {
            "$ref": "#/components/schemas/CatalogUpdated"
          },
          {
            "$ref": "#/components/schemas/SessionCreated"
          },
          {
            "$ref": "#/components/schemas/SessionUpdated"
          },
          {
            "$ref": "#/components/schemas/SessionDeleted"
          },
          {
            "$ref": "#/components/schemas/MessageUpdated"
          },
          {
            "$ref": "#/components/schemas/MessageRemoved"
          },
          {
            "$ref": "#/components/schemas/MessagePartUpdated"
          },
          {
            "$ref": "#/components/schemas/MessagePartRemoved"
          },
          {
            "$ref": "#/components/schemas/SessionNextAgentSwitched"
          },
          {
            "$ref": "#/components/schemas/SessionNextModelSwitched"
          },
          {
            "$ref": "#/components/schemas/SessionNextMoved"
          },
          {
            "$ref": "#/components/schemas/SessionNextPrompted"
          },
          {
            "$ref": "#/components/schemas/SessionNextPromptAdmitted"
          },
          {
            "$ref": "#/components/schemas/SessionNextContextUpdated"
          },
          {
            "$ref": "#/components/schemas/SessionNextSynthetic"
          },
          {
            "$ref": "#/components/schemas/SessionNextShellStarted"
          },
          {
            "$ref": "#/components/schemas/SessionNextShellEnded"
          },
          {
            "$ref": "#/components/schemas/SessionNextStepStarted"
          },
          {
            "$ref": "#/components/schemas/SessionNextStepEnded"
          },
          {
            "$ref": "#/components/schemas/SessionNextStepFailed"
          },
          {
            "$ref": "#/components/schemas/SessionNextTextStarted"
          },
          {
            "$ref": "#/components/schemas/SessionNextTextDelta"
          },
          {
            "$ref": "#/components/schemas/SessionNextTextEnded"
          },
          {
            "$ref": "#/components/schemas/SessionNextReasoningStarted"
          },
          {
            "$ref": "#/components/schemas/SessionNextReasoningDelta"
          },
          {
            "$ref": "#/components/schemas/SessionNextReasoningEnded"
          },
          {
            "$ref": "#/components/schemas/SessionNextToolInputStarted"
          },
          {
            "$ref": "#/components/schemas/SessionNextToolInputDelta"
          },
          {
            "$ref": "#/components/schemas/SessionNextToolInputEnded"
          },
          {
            "$ref": "#/components/schemas/SessionNextToolCalled"
          },
          {
            "$ref": "#/components/schemas/SessionNextToolProgress"
          },
          {
            "$ref": "#/components/schemas/SessionNextToolSuccess"
          },
          {
            "$ref": "#/components/schemas/SessionNextToolFailed"
          },
          {
            "$ref": "#/components/schemas/SessionNextRetried"
          },
          {
            "$ref": "#/components/schemas/SessionNextCompactionStarted"
          },
          {
            "$ref": "#/components/schemas/SessionNextCompactionDelta"
          },
          {
            "$ref": "#/components/schemas/SessionNextCompactionEnded"
          },
          {
            "$ref": "#/components/schemas/SessionNextRevertStaged"
          },
          {
            "$ref": "#/components/schemas/SessionNextRevertCleared"
          },
          {
            "$ref": "#/components/schemas/SessionNextRevertCommitted"
          },
          {
            "$ref": "#/components/schemas/MessagePartDelta"
          },
          {
            "$ref": "#/components/schemas/SessionDiff"
          },
          {
            "$ref": "#/components/schemas/SessionError"
          },
          {
            "$ref": "#/components/schemas/InstallationUpdated"
          },
          {
            "$ref": "#/components/schemas/InstallationUpdate-available"
          },
          {
            "$ref": "#/components/schemas/FileEdited"
          },
          {
            "$ref": "#/components/schemas/ReferenceUpdated"
          },
          {
            "$ref": "#/components/schemas/PermissionV2Asked"
          },
          {
            "$ref": "#/components/schemas/PermissionV2Replied"
          },
          {
            "$ref": "#/components/schemas/PluginAdded"
          },
          {
            "$ref": "#/components/schemas/ProjectDirectoriesUpdated"
          },
          {
            "$ref": "#/components/schemas/FileWatcherUpdated"
          },
          {
            "$ref": "#/components/schemas/PtyCreated"
          },
          {
            "$ref": "#/components/schemas/PtyUpdated"
          },
          {
            "$ref": "#/components/schemas/PtyExited"
          },
          {
            "$ref": "#/components/schemas/PtyDeleted"
          },
          {
            "$ref": "#/components/schemas/QuestionV2Asked"
          },
          {
            "$ref": "#/components/schemas/QuestionV2Replied"
          },
          {
            "$ref": "#/components/schemas/QuestionV2Rejected"
          },
          {
            "$ref": "#/components/schemas/LspUpdated"
          },
          {
            "$ref": "#/components/schemas/PermissionAsked"
          },
          {
            "$ref": "#/components/schemas/PermissionReplied"
          },
          {
            "$ref": "#/components/schemas/TuiPromptAppend"
          },
          {
            "$ref": "#/components/schemas/TuiCommandExecute"
          },
          {
            "$ref": "#/components/schemas/TuiToastShow"
          },
          {
            "$ref": "#/components/schemas/TuiSessionSelect"
          },
          {
            "$ref": "#/components/schemas/McpToolsChanged"
          },
          {
            "$ref": "#/components/schemas/McpBrowserOpenFailed"
          },
          {
            "$ref": "#/components/schemas/CommandExecuted"
          },
          {
            "$ref": "#/components/schemas/ProjectUpdated"
          },
          {
            "$ref": "#/components/schemas/session.status"
          },
          {
            "$ref": "#/components/schemas/SessionIdle"
          },
          {
            "$ref": "#/components/schemas/QuestionAsked"
          },
          {
            "$ref": "#/components/schemas/question.replied"
          },
          {
            "$ref": "#/components/schemas/question.rejected"
          },
          {
            "$ref": "#/components/schemas/SessionCompacted"
          },
          {
            "$ref": "#/components/schemas/VcsBranchUpdated"
          },
          {
            "$ref": "#/components/schemas/WorkspaceReady"
          },
          {
            "$ref": "#/components/schemas/WorkspaceFailed"
          },
          {
            "$ref": "#/components/schemas/WorkspaceStatus"
          },
          {
            "$ref": "#/components/schemas/WorktreeReady"
          },
          {
            "$ref": "#/components/schemas/WorktreeFailed"
          },
          {
            "$ref": "#/components/schemas/ServerConnected"
          },
          {
            "$ref": "#/components/schemas/GlobalDisposed"
          }
        ]
      },
      "V2EventStream": {
        "type": "string",
        "contentSchema": {
          "$ref": "#/components/schemas/V2Event"
        },
        "contentMediaType": "application/json"
      },
      "ForbiddenError": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": ["ForbiddenError"]
          },
          "message": {
            "type": "string"
          }
        },
        "required": ["_tag", "message"],
        "additionalProperties": false
      },
      "ProjectCopyError": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": ["ProjectCopyError"]
          },
          "data": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              },
              "forceRequired": {
                "type": "boolean"
              }
            },
            "required": ["message"],
            "additionalProperties": false
          }
        },
        "required": ["name", "data"],
        "additionalProperties": false
      },
      "effect_HttpApiError_Forbidden": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": ["Forbidden"]
          }
        },
        "required": ["_tag"],
        "additionalProperties": false
      },
      "Event.tui.prompt.append": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["tui.prompt.append"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              }
            },
            "required": ["text"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "Event.tui.command.execute": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["tui.command.execute"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "command": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "session.list",
                      "session.new",
                      "session.share",
                      "session.interrupt",
                      "session.compact",
                      "session.page.up",
                      "session.page.down",
                      "session.line.up",
                      "session.line.down",
                      "session.half.page.up",
                      "session.half.page.down",
                      "session.first",
                      "session.last",
                      "prompt.clear",
                      "prompt.submit",
                      "agent.cycle"
                    ]
                  },
                  {
                    "type": "string"
                  }
                ]
              }
            },
            "required": ["command"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "Event.tui.toast.show": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["tui.toast.show"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "title": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "variant": {
                "type": "string",
                "enum": ["info", "success", "warning", "error"]
              },
              "duration": {
                "type": "integer",
                "exclusiveMinimum": 0
              }
            },
            "required": ["message", "variant"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "Event.tui.session.select": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["tui.session.select"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses",
                "description": "Session ID to navigate to"
              }
            },
            "required": ["sessionID"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "CredentialValue": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/CredentialOAuth"
          },
          {
            "$ref": "#/components/schemas/CredentialKey"
          }
        ]
      },
      "IntegrationInputs": {
        "type": "object",
        "additionalProperties": {
          "type": "string"
        }
      },
      "IntegrationMethod": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/IntegrationOAuthMethod"
          },
          {
            "$ref": "#/components/schemas/IntegrationKeyMethod"
          },
          {
            "$ref": "#/components/schemas/IntegrationEnvMethod"
          }
        ]
      },
      "IntegrationRef": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": ["id", "name"],
        "additionalProperties": false
      },
      "SkillV2Source": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/SkillV2DirectorySource"
          },
          {
            "$ref": "#/components/schemas/SkillV2UrlSource"
          },
          {
            "$ref": "#/components/schemas/SkillV2EmbeddedSource"
          }
        ]
      },
      "MoveSessionDestination": {
        "type": "object",
        "properties": {
          "directory": {
            "type": "string"
          }
        },
        "required": ["directory"],
        "additionalProperties": false
      },
      "ModelRef": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "providerID": {
            "type": "string"
          },
          "variant": {
            "type": "string"
          }
        },
        "required": ["id", "providerID"],
        "additionalProperties": false
      },
      "LocationRef": {
        "type": "object",
        "properties": {
          "directory": {
            "type": "string"
          },
          "workspaceID": {
            "type": "string",
            "pattern": "^wrk"
          }
        },
        "required": ["directory"],
        "additionalProperties": false
      },
      "PromptSource": {
        "type": "object",
        "properties": {
          "start": {
            "type": "number"
          },
          "end": {
            "type": "number"
          },
          "text": {
            "type": "string"
          }
        },
        "required": ["start", "end", "text"],
        "additionalProperties": false
      },
      "PromptFileAttachment": {
        "type": "object",
        "properties": {
          "uri": {
            "type": "string"
          },
          "mime": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "source": {
            "$ref": "#/components/schemas/PromptSource"
          }
        },
        "required": ["uri", "mime"],
        "additionalProperties": false
      },
      "PromptAgentAttachment": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "source": {
            "$ref": "#/components/schemas/PromptSource"
          }
        },
        "required": ["name"],
        "additionalProperties": false
      },
      "SessionErrorUnknown": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["unknown"]
          },
          "message": {
            "type": "string"
          }
        },
        "required": ["type", "message"],
        "additionalProperties": false
      },
      "LLMProviderMetadata": {
        "type": "object",
        "additionalProperties": {
          "type": "object"
        }
      },
      "ToolTextContent": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["text"]
          },
          "text": {
            "type": "string"
          }
        },
        "required": ["type", "text"],
        "additionalProperties": false
      },
      "ToolFileContent": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["file"]
          },
          "uri": {
            "type": "string"
          },
          "mime": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": ["type", "uri", "mime"],
        "additionalProperties": false
      },
      "LLMToolContent": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/ToolTextContent"
          },
          {
            "$ref": "#/components/schemas/ToolFileContent"
          }
        ]
      },
      "SessionNextRetry_error": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "statusCode": {
            "type": "number"
          },
          "isRetryable": {
            "type": "boolean"
          },
          "responseHeaders": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "responseBody": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "required": ["message", "isRetryable"],
        "additionalProperties": false
      },
      "FileDiff": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": ["added", "modified", "deleted"]
          },
          "additions": {
            "type": "integer",
            "minimum": 0
          },
          "deletions": {
            "type": "integer",
            "minimum": 0
          },
          "patch": {
            "type": "string"
          }
        },
        "required": ["path", "status", "additions", "deletions", "patch"],
        "additionalProperties": false
      },
      "RevertState": {
        "type": "object",
        "properties": {
          "messageID": {
            "type": "string",
            "pattern": "^msg_"
          },
          "partID": {
            "type": "string"
          },
          "snapshot": {
            "type": "string"
          },
          "diff": {
            "type": "string"
          },
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FileDiff"
            }
          }
        },
        "required": ["messageID"],
        "additionalProperties": false
      },
      "PermissionV2Source": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["tool"]
          },
          "messageID": {
            "type": "string"
          },
          "callID": {
            "type": "string"
          }
        },
        "required": ["type", "messageID", "callID"],
        "additionalProperties": false
      },
      "PermissionV2Reply": {
        "type": "string",
        "enum": ["once", "always", "reject"]
      },
      "QuestionV2Option": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "description": "Display text (1-5 words, concise)"
          },
          "description": {
            "type": "string",
            "description": "Explanation of choice"
          }
        },
        "required": ["label", "description"],
        "additionalProperties": false
      },
      "QuestionV2Info": {
        "type": "object",
        "properties": {
          "question": {
            "type": "string",
            "description": "Complete question"
          },
          "header": {
            "type": "string",
            "description": "Very short label (max 30 chars)"
          },
          "options": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuestionV2Option"
            },
            "description": "Available choices"
          },
          "multiple": {
            "type": "boolean"
          },
          "custom": {
            "type": "boolean"
          }
        },
        "required": ["question", "header", "options"],
        "additionalProperties": false
      },
      "QuestionV2Tool": {
        "type": "object",
        "properties": {
          "messageID": {
            "type": "string"
          },
          "callID": {
            "type": "string"
          }
        },
        "required": ["messageID", "callID"],
        "additionalProperties": false
      },
      "QuestionV2Answer": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "ProjectVcs": {
        "type": "string",
        "enum": ["git"]
      },
      "ProjectIcon": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "override": {
            "type": "string"
          },
          "color": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "ProjectCommands": {
        "type": "object",
        "properties": {
          "start": {
            "type": "string",
            "description": "Startup script to run when creating a new workspace (worktree)"
          }
        },
        "additionalProperties": false
      },
      "ProjectTime": {
        "type": "object",
        "properties": {
          "created": {
            "type": "integer",
            "minimum": 0
          },
          "updated": {
            "type": "integer",
            "minimum": 0
          },
          "initialized": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": ["created", "updated"],
        "additionalProperties": false
      },
      "EventServerInstanceDisposed": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": ["server.instance.disposed"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "directory": {
                "type": "string"
              }
            },
            "required": ["directory"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "SyncEventSessionCreated": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["session.created.1"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "info": {
                    "$ref": "#/components/schemas/Session"
                  }
                },
                "required": ["sessionID", "info"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventSessionUpdated": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["session.updated.1"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "info": {
                    "$ref": "#/components/schemas/Session"
                  }
                },
                "required": ["sessionID", "info"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventSessionDeleted": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["session.deleted.1"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "info": {
                    "$ref": "#/components/schemas/Session"
                  }
                },
                "required": ["sessionID", "info"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventMessageUpdated": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["message.updated.1"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "info": {
                    "$ref": "#/components/schemas/Message"
                  }
                },
                "required": ["sessionID", "info"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventMessageRemoved": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["message.removed.1"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "messageID": {
                    "type": "string",
                    "pattern": "^msg"
                  }
                },
                "required": ["sessionID", "messageID"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventMessagePartUpdated": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["message.part.updated.1"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "part": {
                    "$ref": "#/components/schemas/Part"
                  },
                  "time": {
                    "type": "number"
                  }
                },
                "required": ["sessionID", "part", "time"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventMessagePartRemoved": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["message.part.removed.1"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "messageID": {
                    "type": "string",
                    "pattern": "^msg"
                  },
                  "partID": {
                    "type": "string",
                    "pattern": "^prt"
                  }
                },
                "required": ["sessionID", "messageID", "partID"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventSessionNextAgentSwitched": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["session.next.agent.switched.1"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "timestamp": {
                    "type": "number"
                  },
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "messageID": {
                    "type": "string",
                    "pattern": "^msg_"
                  },
                  "agent": {
                    "type": "string"
                  }
                },
                "required": ["timestamp", "sessionID", "messageID", "agent"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventSessionNextModelSwitched": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["session.next.model.switched.1"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "timestamp": {
                    "type": "number"
                  },
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "messageID": {
                    "type": "string",
                    "pattern": "^msg_"
                  },
                  "model": {
                    "$ref": "#/components/schemas/ModelRef"
                  }
                },
                "required": ["timestamp", "sessionID", "messageID", "model"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventSessionNextMoved": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["session.next.moved.1"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "timestamp": {
                    "type": "number"
                  },
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "location": {
                    "$ref": "#/components/schemas/LocationRef"
                  },
                  "subdirectory": {
                    "type": "string"
                  }
                },
                "required": ["timestamp", "sessionID", "location"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventSessionNextPrompted": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["session.next.prompted.1"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "timestamp": {
                    "type": "number"
                  },
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "messageID": {
                    "type": "string",
                    "pattern": "^msg_"
                  },
                  "prompt": {
                    "$ref": "#/components/schemas/Prompt"
                  },
                  "delivery": {
                    "type": "string",
                    "enum": ["steer", "queue"]
                  }
                },
                "required": ["timestamp", "sessionID", "messageID", "prompt", "delivery"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventSessionNextPromptAdmitted": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["session.next.prompt.admitted.1"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "timestamp": {
                    "type": "number"
                  },
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "messageID": {
                    "type": "string",
                    "pattern": "^msg_"
                  },
                  "prompt": {
                    "$ref": "#/components/schemas/Prompt"
                  },
                  "delivery": {
                    "type": "string",
                    "enum": ["steer", "queue"]
                  }
                },
                "required": ["timestamp", "sessionID", "messageID", "prompt", "delivery"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventSessionNextContextUpdated": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["session.next.context.updated.1"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "timestamp": {
                    "type": "number"
                  },
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "messageID": {
                    "type": "string",
                    "pattern": "^msg_"
                  },
                  "text": {
                    "type": "string"
                  }
                },
                "required": ["timestamp", "sessionID", "messageID", "text"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventSessionNextSynthetic": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["session.next.synthetic.1"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "timestamp": {
                    "type": "number"
                  },
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "messageID": {
                    "type": "string",
                    "pattern": "^msg_"
                  },
                  "text": {
                    "type": "string"
                  }
                },
                "required": ["timestamp", "sessionID", "messageID", "text"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventSessionNextShellStarted": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["session.next.shell.started.1"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "timestamp": {
                    "type": "number"
                  },
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "messageID": {
                    "type": "string",
                    "pattern": "^msg_"
                  },
                  "callID": {
                    "type": "string"
                  },
                  "command": {
                    "type": "string"
                  }
                },
                "required": ["timestamp", "sessionID", "messageID", "callID", "command"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventSessionNextShellEnded": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["session.next.shell.ended.1"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "timestamp": {
                    "type": "number"
                  },
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "callID": {
                    "type": "string"
                  },
                  "output": {
                    "type": "string"
                  }
                },
                "required": ["timestamp", "sessionID", "callID", "output"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventSessionNextStepStarted": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["session.next.step.started.1"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "timestamp": {
                    "type": "number"
                  },
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "assistantMessageID": {
                    "type": "string",
                    "pattern": "^msg_"
                  },
                  "agent": {
                    "type": "string"
                  },
                  "model": {
                    "$ref": "#/components/schemas/ModelRef"
                  },
                  "snapshot": {
                    "type": "string"
                  }
                },
                "required": ["timestamp", "sessionID", "assistantMessageID", "agent", "model"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventSessionNextStepEnded": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["session.next.step.ended.2"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "timestamp": {
                    "type": "number"
                  },
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "assistantMessageID": {
                    "type": "string",
                    "pattern": "^msg_"
                  },
                  "finish": {
                    "type": "string"
                  },
                  "cost": {
                    "type": "number"
                  },
                  "tokens": {
                    "type": "object",
                    "properties": {
                      "input": {
                        "type": "number"
                      },
                      "output": {
                        "type": "number"
                      },
                      "reasoning": {
                        "type": "number"
                      },
                      "cache": {
                        "type": "object",
                        "properties": {
                          "read": {
                            "type": "number"
                          },
                          "write": {
                            "type": "number"
                          }
                        },
                        "required": ["read", "write"],
                        "additionalProperties": false
                      }
                    },
                    "required": ["input", "output", "reasoning", "cache"],
                    "additionalProperties": false
                  },
                  "snapshot": {
                    "type": "string"
                  },
                  "files": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": ["timestamp", "sessionID", "assistantMessageID", "finish", "cost", "tokens"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventSessionNextStepFailed": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["session.next.step.failed.2"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "timestamp": {
                    "type": "number"
                  },
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "assistantMessageID": {
                    "type": "string",
                    "pattern": "^msg_"
                  },
                  "error": {
                    "$ref": "#/components/schemas/SessionErrorUnknown"
                  }
                },
                "required": ["timestamp", "sessionID", "assistantMessageID", "error"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventSessionNextTextStarted": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["session.next.text.started.1"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "timestamp": {
                    "type": "number"
                  },
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "assistantMessageID": {
                    "type": "string",
                    "pattern": "^msg_"
                  },
                  "textID": {
                    "type": "string"
                  }
                },
                "required": ["timestamp", "sessionID", "assistantMessageID", "textID"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventSessionNextTextEnded": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["session.next.text.ended.1"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "timestamp": {
                    "type": "number"
                  },
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "assistantMessageID": {
                    "type": "string",
                    "pattern": "^msg_"
                  },
                  "textID": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string"
                  }
                },
                "required": ["timestamp", "sessionID", "assistantMessageID", "textID", "text"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventSessionNextReasoningStarted": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["session.next.reasoning.started.1"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "timestamp": {
                    "type": "number"
                  },
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "assistantMessageID": {
                    "type": "string",
                    "pattern": "^msg_"
                  },
                  "reasoningID": {
                    "type": "string"
                  },
                  "providerMetadata": {
                    "$ref": "#/components/schemas/LLMProviderMetadata"
                  }
                },
                "required": ["timestamp", "sessionID", "assistantMessageID", "reasoningID"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventSessionNextReasoningEnded": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["session.next.reasoning.ended.1"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "timestamp": {
                    "type": "number"
                  },
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "assistantMessageID": {
                    "type": "string",
                    "pattern": "^msg_"
                  },
                  "reasoningID": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string"
                  },
                  "providerMetadata": {
                    "$ref": "#/components/schemas/LLMProviderMetadata"
                  }
                },
                "required": ["timestamp", "sessionID", "assistantMessageID", "reasoningID", "text"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventSessionNextToolInputStarted": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["session.next.tool.input.started.1"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "timestamp": {
                    "type": "number"
                  },
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "assistantMessageID": {
                    "type": "string",
                    "pattern": "^msg_"
                  },
                  "callID": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "name"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventSessionNextToolInputEnded": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["session.next.tool.input.ended.1"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "timestamp": {
                    "type": "number"
                  },
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "assistantMessageID": {
                    "type": "string",
                    "pattern": "^msg_"
                  },
                  "callID": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string"
                  }
                },
                "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "text"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventSessionNextToolCalled": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["session.next.tool.called.1"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "timestamp": {
                    "type": "number"
                  },
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "assistantMessageID": {
                    "type": "string",
                    "pattern": "^msg_"
                  },
                  "callID": {
                    "type": "string"
                  },
                  "tool": {
                    "type": "string"
                  },
                  "input": {
                    "type": "object"
                  },
                  "provider": {
                    "type": "object",
                    "properties": {
                      "executed": {
                        "type": "boolean"
                      },
                      "metadata": {
                        "$ref": "#/components/schemas/LLMProviderMetadata"
                      }
                    },
                    "required": ["executed"],
                    "additionalProperties": false
                  }
                },
                "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "tool", "input", "provider"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventSessionNextToolProgress": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["session.next.tool.progress.1"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "timestamp": {
                    "type": "number"
                  },
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "assistantMessageID": {
                    "type": "string",
                    "pattern": "^msg_"
                  },
                  "callID": {
                    "type": "string"
                  },
                  "structured": {
                    "type": "object"
                  },
                  "content": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/LLMToolContent"
                    }
                  }
                },
                "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "structured", "content"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventSessionNextToolSuccess": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["session.next.tool.success.1"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "timestamp": {
                    "type": "number"
                  },
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "assistantMessageID": {
                    "type": "string",
                    "pattern": "^msg_"
                  },
                  "callID": {
                    "type": "string"
                  },
                  "structured": {
                    "type": "object"
                  },
                  "content": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/LLMToolContent"
                    }
                  },
                  "outputPaths": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "result": {},
                  "provider": {
                    "type": "object",
                    "properties": {
                      "executed": {
                        "type": "boolean"
                      },
                      "metadata": {
                        "$ref": "#/components/schemas/LLMProviderMetadata"
                      }
                    },
                    "required": ["executed"],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "timestamp",
                  "sessionID",
                  "assistantMessageID",
                  "callID",
                  "structured",
                  "content",
                  "provider"
                ],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventSessionNextToolFailed": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["session.next.tool.failed.1"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "timestamp": {
                    "type": "number"
                  },
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "assistantMessageID": {
                    "type": "string",
                    "pattern": "^msg_"
                  },
                  "callID": {
                    "type": "string"
                  },
                  "error": {
                    "$ref": "#/components/schemas/SessionErrorUnknown"
                  },
                  "result": {},
                  "provider": {
                    "type": "object",
                    "properties": {
                      "executed": {
                        "type": "boolean"
                      },
                      "metadata": {
                        "$ref": "#/components/schemas/LLMProviderMetadata"
                      }
                    },
                    "required": ["executed"],
                    "additionalProperties": false
                  }
                },
                "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "error", "provider"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventSessionNextRetried": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["session.next.retried.1"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "timestamp": {
                    "type": "number"
                  },
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "attempt": {
                    "type": "number"
                  },
                  "error": {
                    "$ref": "#/components/schemas/SessionNextRetry_error"
                  }
                },
                "required": ["timestamp", "sessionID", "attempt", "error"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventSessionNextCompactionStarted": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["session.next.compaction.started.1"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "timestamp": {
                    "type": "number"
                  },
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "messageID": {
                    "type": "string",
                    "pattern": "^msg_"
                  },
                  "reason": {
                    "type": "string",
                    "enum": ["auto", "manual"]
                  }
                },
                "required": ["timestamp", "sessionID", "messageID", "reason"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventSessionNextCompactionEnded": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["session.next.compaction.ended.1"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "timestamp": {
                    "type": "number"
                  },
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "messageID": {
                    "type": "string",
                    "pattern": "^msg_"
                  },
                  "reason": {
                    "type": "string",
                    "enum": ["auto", "manual"]
                  },
                  "text": {
                    "type": "string"
                  },
                  "recent": {
                    "type": "string"
                  }
                },
                "required": ["timestamp", "sessionID", "messageID", "reason", "text", "recent"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventSessionNextRevertStaged": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["session.next.revert.staged.1"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "timestamp": {
                    "type": "number"
                  },
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "revert": {
                    "$ref": "#/components/schemas/RevertState"
                  }
                },
                "required": ["timestamp", "sessionID", "revert"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventSessionNextRevertCleared": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["session.next.revert.cleared.1"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "timestamp": {
                    "type": "number"
                  },
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  }
                },
                "required": ["timestamp", "sessionID"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "SyncEventSessionNextRevertCommitted": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["sync"]
          },
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "syncEvent": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["session.next.revert.committed.1"]
              },
              "id": {
                "type": "string",
                "pattern": "^evt_"
              },
              "seq": {
                "type": "number"
              },
              "aggregateID": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "timestamp": {
                    "type": "number"
                  },
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses"
                  },
                  "messageID": {
                    "type": "string",
                    "pattern": "^msg_"
                  }
                },
                "required": ["timestamp", "sessionID", "messageID"],
                "additionalProperties": false
              }
            },
            "required": ["type", "id", "seq", "aggregateID", "data"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "syncEvent"],
        "additionalProperties": false
      },
      "ConfigV2ReferenceGit": {
        "type": "object",
        "properties": {
          "repository": {
            "type": "string"
          },
          "branch": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "hidden": {
            "type": "boolean"
          }
        },
        "required": ["repository"],
        "additionalProperties": false
      },
      "ConfigV2ReferenceLocal": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "hidden": {
            "type": "boolean"
          }
        },
        "required": ["path"],
        "additionalProperties": false
      },
      "PolicyEffect": {
        "type": "string",
        "enum": ["allow", "deny"]
      },
      "ConfigV2ExperimentalPolicy": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "enum": ["provider.use"]
          },
          "effect": {
            "$ref": "#/components/schemas/PolicyEffect"
          },
          "resource": {
            "type": "string"
          }
        },
        "required": ["action", "effect", "resource"],
        "additionalProperties": false
      },
      "ProjectDirectories": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "directory": {
              "type": "string"
            },
            "strategy": {
              "type": "string"
            }
          },
          "required": ["directory"],
          "additionalProperties": false
        }
      },
      "PtyTicketConnectToken": {
        "type": "object",
        "properties": {
          "ticket": {
            "type": "string"
          },
          "expires_in": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": ["ticket", "expires_in"],
        "additionalProperties": false
      },
      "WorkspaceEventConnectionStatus": {
        "type": "object",
        "properties": {
          "workspaceID": {
            "type": "string",
            "pattern": "^wrk"
          },
          "status": {
            "type": "string",
            "enum": ["connected", "connecting", "disconnected", "error"]
          }
        },
        "required": ["workspaceID", "status"],
        "additionalProperties": false
      },
      "LocationInfo": {
        "type": "object",
        "properties": {
          "directory": {
            "type": "string"
          },
          "workspaceID": {
            "type": "string",
            "pattern": "^wrk"
          },
          "project": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "directory": {
                "type": "string"
              }
            },
            "required": ["id", "directory"],
            "additionalProperties": false
          }
        },
        "required": ["directory", "project"],
        "additionalProperties": false
      },
      "ProviderRequest": {
        "type": "object",
        "properties": {
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "body": {
            "type": "object"
          }
        },
        "required": ["headers", "body"],
        "additionalProperties": false
      },
      "AgentColor": {
        "anyOf": [
          {
            "type": "string",
            "pattern": "^#[0-9a-fA-F]{6}$"
          },
          {
            "type": "string",
            "enum": ["primary", "secondary", "accent", "success", "warning", "error", "info"]
          }
        ]
      },
      "PermissionV2Effect": {
        "type": "string",
        "enum": ["allow", "deny", "ask"]
      },
      "PermissionV2Rule": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string"
          },
          "resource": {
            "type": "string"
          },
          "effect": {
            "$ref": "#/components/schemas/PermissionV2Effect"
          }
        },
        "required": ["action", "resource", "effect"],
        "additionalProperties": false
      },
      "PermissionV2Ruleset": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/PermissionV2Rule"
        }
      },
      "AgentV2Info": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "model": {
            "$ref": "#/components/schemas/ModelRef"
          },
          "request": {
            "$ref": "#/components/schemas/ProviderRequest"
          },
          "system": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "mode": {
            "type": "string",
            "enum": ["subagent", "primary", "all"]
          },
          "hidden": {
            "type": "boolean"
          },
          "color": {
            "$ref": "#/components/schemas/AgentColor"
          },
          "steps": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "permissions": {
            "$ref": "#/components/schemas/PermissionV2Ruleset"
          }
        },
        "required": ["id", "request", "mode", "hidden", "permissions"],
        "additionalProperties": false
      },
      "SessionV2Info": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^ses"
          },
          "parentID": {
            "type": "string",
            "pattern": "^ses"
          },
          "projectID": {
            "type": "string"
          },
          "agent": {
            "type": "string"
          },
          "model": {
            "$ref": "#/components/schemas/ModelRef"
          },
          "cost": {
            "type": "number"
          },
          "tokens": {
            "type": "object",
            "properties": {
              "input": {
                "type": "number"
              },
              "output": {
                "type": "number"
              },
              "reasoning": {
                "type": "number"
              },
              "cache": {
                "type": "object",
                "properties": {
                  "read": {
                    "type": "number"
                  },
                  "write": {
                    "type": "number"
                  }
                },
                "required": ["read", "write"],
                "additionalProperties": false
              }
            },
            "required": ["input", "output", "reasoning", "cache"],
            "additionalProperties": false
          },
          "time": {
            "type": "object",
            "properties": {
              "created": {
                "type": "number"
              },
              "updated": {
                "type": "number"
              },
              "archived": {
                "type": "number"
              }
            },
            "required": ["created", "updated"],
            "additionalProperties": false
          },
          "title": {
            "type": "string"
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "subpath": {
            "type": "string"
          },
          "revert": {
            "$ref": "#/components/schemas/RevertState"
          }
        },
        "required": ["id", "projectID", "cost", "tokens", "time", "title", "location"],
        "additionalProperties": false
      },
      "PromptInputFileAttachment": {
        "type": "object",
        "properties": {
          "uri": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "source": {
            "$ref": "#/components/schemas/PromptSource"
          }
        },
        "required": ["uri"],
        "additionalProperties": false
      },
      "SessionInputAdmitted": {
        "type": "object",
        "properties": {
          "admittedSeq": {
            "type": "integer",
            "minimum": 0
          },
          "id": {
            "type": "string",
            "pattern": "^msg_"
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses"
          },
          "prompt": {
            "$ref": "#/components/schemas/Prompt"
          },
          "delivery": {
            "type": "string",
            "enum": ["steer", "queue"]
          },
          "timeCreated": {
            "type": "number"
          },
          "promotedSeq": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": ["admittedSeq", "id", "sessionID", "prompt", "delivery", "timeCreated"],
        "additionalProperties": false
      },
      "SessionMessageAgentSwitched": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^msg_"
          },
          "metadata": {
            "type": "object"
          },
          "time": {
            "type": "object",
            "properties": {
              "created": {
                "type": "number"
              }
            },
            "required": ["created"],
            "additionalProperties": false
          },
          "type": {
            "type": "string",
            "enum": ["agent-switched"]
          },
          "agent": {
            "type": "string"
          }
        },
        "required": ["id", "time", "type", "agent"],
        "additionalProperties": false
      },
      "SessionMessageModelSwitched": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^msg_"
          },
          "metadata": {
            "type": "object"
          },
          "time": {
            "type": "object",
            "properties": {
              "created": {
                "type": "number"
              }
            },
            "required": ["created"],
            "additionalProperties": false
          },
          "type": {
            "type": "string",
            "enum": ["model-switched"]
          },
          "model": {
            "$ref": "#/components/schemas/ModelRef"
          }
        },
        "required": ["id", "time", "type", "model"],
        "additionalProperties": false
      },
      "SessionMessageUser": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^msg_"
          },
          "metadata": {
            "type": "object"
          },
          "time": {
            "type": "object",
            "properties": {
              "created": {
                "type": "number"
              }
            },
            "required": ["created"],
            "additionalProperties": false
          },
          "text": {
            "type": "string"
          },
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PromptFileAttachment"
            }
          },
          "agents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PromptAgentAttachment"
            }
          },
          "type": {
            "type": "string",
            "enum": ["user"]
          }
        },
        "required": ["id", "time", "text", "type"],
        "additionalProperties": false
      },
      "SessionMessageSynthetic": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^msg_"
          },
          "metadata": {
            "type": "object"
          },
          "time": {
            "type": "object",
            "properties": {
              "created": {
                "type": "number"
              }
            },
            "required": ["created"],
            "additionalProperties": false
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses"
          },
          "text": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": ["session.synthetic"]
          }
        },
        "required": ["id", "time", "sessionID", "text", "type"],
        "additionalProperties": false
      },
      "SessionMessageSystem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^msg_"
          },
          "metadata": {
            "type": "object"
          },
          "time": {
            "type": "object",
            "properties": {
              "created": {
                "type": "number"
              }
            },
            "required": ["created"],
            "additionalProperties": false
          },
          "type": {
            "type": "string",
            "enum": ["system"]
          },
          "text": {
            "type": "string"
          }
        },
        "required": ["id", "time", "type", "text"],
        "additionalProperties": false
      },
      "SessionMessageShell": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^msg_"
          },
          "metadata": {
            "type": "object"
          },
          "time": {
            "type": "object",
            "properties": {
              "created": {
                "type": "number"
              },
              "completed": {
                "type": "number"
              }
            },
            "required": ["created"],
            "additionalProperties": false
          },
          "type": {
            "type": "string",
            "enum": ["shell"]
          },
          "callID": {
            "type": "string"
          },
          "command": {
            "type": "string"
          },
          "output": {
            "type": "string"
          }
        },
        "required": ["id", "time", "type", "callID", "command", "output"],
        "additionalProperties": false
      },
      "SessionMessageAssistantText": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["text"]
          },
          "id": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        },
        "required": ["type", "id", "text"],
        "additionalProperties": false
      },
      "SessionMessageAssistantReasoning": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["reasoning"]
          },
          "id": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "providerMetadata": {
            "$ref": "#/components/schemas/LLMProviderMetadata"
          },
          "time": {
            "type": "object",
            "properties": {
              "created": {
                "type": "number"
              },
              "completed": {
                "type": "number"
              }
            },
            "required": ["created"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "text"],
        "additionalProperties": false
      },
      "SessionMessageToolStatePending": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": ["pending"]
          },
          "input": {
            "type": "string"
          }
        },
        "required": ["status", "input"],
        "additionalProperties": false
      },
      "SessionMessageToolStateRunning": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": ["running"]
          },
          "input": {
            "type": "object"
          },
          "structured": {
            "type": "object"
          },
          "content": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LLMToolContent"
            }
          }
        },
        "required": ["status", "input", "structured", "content"],
        "additionalProperties": false
      },
      "SessionMessageToolStateCompleted": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": ["completed"]
          },
          "input": {
            "type": "object"
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PromptFileAttachment"
            }
          },
          "content": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LLMToolContent"
            }
          },
          "outputPaths": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "structured": {
            "type": "object"
          },
          "result": {}
        },
        "required": ["status", "input", "content", "structured"],
        "additionalProperties": false
      },
      "SessionMessageToolStateError": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": ["error"]
          },
          "input": {
            "type": "object"
          },
          "content": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LLMToolContent"
            }
          },
          "structured": {
            "type": "object"
          },
          "error": {
            "$ref": "#/components/schemas/SessionErrorUnknown"
          },
          "result": {}
        },
        "required": ["status", "input", "content", "structured", "error"],
        "additionalProperties": false
      },
      "SessionMessageAssistantTool": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["tool"]
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "provider": {
            "type": "object",
            "properties": {
              "executed": {
                "type": "boolean"
              },
              "metadata": {
                "$ref": "#/components/schemas/LLMProviderMetadata"
              },
              "resultMetadata": {
                "$ref": "#/components/schemas/LLMProviderMetadata"
              }
            },
            "required": ["executed"],
            "additionalProperties": false
          },
          "state": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SessionMessageToolStatePending"
              },
              {
                "$ref": "#/components/schemas/SessionMessageToolStateRunning"
              },
              {
                "$ref": "#/components/schemas/SessionMessageToolStateCompleted"
              },
              {
                "$ref": "#/components/schemas/SessionMessageToolStateError"
              }
            ]
          },
          "time": {
            "type": "object",
            "properties": {
              "created": {
                "type": "number"
              },
              "ran": {
                "type": "number"
              },
              "completed": {
                "type": "number"
              },
              "pruned": {
                "type": "number"
              }
            },
            "required": ["created"],
            "additionalProperties": false
          }
        },
        "required": ["type", "id", "name", "state", "time"],
        "additionalProperties": false
      },
      "SessionMessageAssistant": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^msg_"
          },
          "metadata": {
            "type": "object"
          },
          "time": {
            "type": "object",
            "properties": {
              "created": {
                "type": "number"
              },
              "completed": {
                "type": "number"
              }
            },
            "required": ["created"],
            "additionalProperties": false
          },
          "type": {
            "type": "string",
            "enum": ["assistant"]
          },
          "agent": {
            "type": "string"
          },
          "model": {
            "$ref": "#/components/schemas/ModelRef"
          },
          "content": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/SessionMessageAssistantText"
                },
                {
                  "$ref": "#/components/schemas/SessionMessageAssistantReasoning"
                },
                {
                  "$ref": "#/components/schemas/SessionMessageAssistantTool"
                }
              ]
            }
          },
          "snapshot": {
            "type": "object",
            "properties": {
              "start": {
                "type": "string"
              },
              "end": {
                "type": "string"
              },
              "files": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "additionalProperties": false
          },
          "finish": {
            "type": "string"
          },
          "cost": {
            "type": "number"
          },
          "tokens": {
            "type": "object",
            "properties": {
              "input": {
                "type": "number"
              },
              "output": {
                "type": "number"
              },
              "reasoning": {
                "type": "number"
              },
              "cache": {
                "type": "object",
                "properties": {
                  "read": {
                    "type": "number"
                  },
                  "write": {
                    "type": "number"
                  }
                },
                "required": ["read", "write"],
                "additionalProperties": false
              }
            },
            "required": ["input", "output", "reasoning", "cache"],
            "additionalProperties": false
          },
          "error": {
            "$ref": "#/components/schemas/SessionErrorUnknown"
          }
        },
        "required": ["id", "time", "type", "agent", "model", "content"],
        "additionalProperties": false
      },
      "SessionMessageCompaction": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["compaction"]
          },
          "reason": {
            "type": "string",
            "enum": ["auto", "manual"]
          },
          "summary": {
            "type": "string"
          },
          "recent": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "pattern": "^msg_"
          },
          "metadata": {
            "type": "object"
          },
          "time": {
            "type": "object",
            "properties": {
              "created": {
                "type": "number"
              }
            },
            "required": ["created"],
            "additionalProperties": false
          }
        },
        "required": ["type", "reason", "summary", "recent", "id", "time"],
        "additionalProperties": false
      },
      "SessionMessage": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/SessionMessageAgentSwitched"
          },
          {
            "$ref": "#/components/schemas/SessionMessageModelSwitched"
          },
          {
            "$ref": "#/components/schemas/SessionMessageUser"
          },
          {
            "$ref": "#/components/schemas/SessionMessageSynthetic"
          },
          {
            "$ref": "#/components/schemas/SessionMessageSystem"
          },
          {
            "$ref": "#/components/schemas/SessionMessageShell"
          },
          {
            "$ref": "#/components/schemas/SessionMessageAssistant"
          },
          {
            "$ref": "#/components/schemas/SessionMessageCompaction"
          }
        ]
      },
      "SessionNextAgentSwitched": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.agent.switched"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "messageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "agent": {
                "type": "string"
              }
            },
            "required": ["timestamp", "sessionID", "messageID", "agent"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionNextModelSwitched": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.model.switched"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "messageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "model": {
                "$ref": "#/components/schemas/ModelRef"
              }
            },
            "required": ["timestamp", "sessionID", "messageID", "model"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionNextMoved": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.moved"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "location": {
                "$ref": "#/components/schemas/LocationRef"
              },
              "subdirectory": {
                "type": "string"
              }
            },
            "required": ["timestamp", "sessionID", "location"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionNextPrompted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.prompted"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "messageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "prompt": {
                "$ref": "#/components/schemas/Prompt"
              },
              "delivery": {
                "type": "string",
                "enum": ["steer", "queue"]
              }
            },
            "required": ["timestamp", "sessionID", "messageID", "prompt", "delivery"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionNextPromptAdmitted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.prompt.admitted"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "messageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "prompt": {
                "$ref": "#/components/schemas/Prompt"
              },
              "delivery": {
                "type": "string",
                "enum": ["steer", "queue"]
              }
            },
            "required": ["timestamp", "sessionID", "messageID", "prompt", "delivery"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionNextContextUpdated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.context.updated"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "messageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "text": {
                "type": "string"
              }
            },
            "required": ["timestamp", "sessionID", "messageID", "text"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionNextSynthetic": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.synthetic"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "messageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "text": {
                "type": "string"
              }
            },
            "required": ["timestamp", "sessionID", "messageID", "text"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionNextShellStarted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.shell.started"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "messageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "callID": {
                "type": "string"
              },
              "command": {
                "type": "string"
              }
            },
            "required": ["timestamp", "sessionID", "messageID", "callID", "command"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionNextShellEnded": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.shell.ended"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "callID": {
                "type": "string"
              },
              "output": {
                "type": "string"
              }
            },
            "required": ["timestamp", "sessionID", "callID", "output"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionNextStepStarted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.step.started"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "assistantMessageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "agent": {
                "type": "string"
              },
              "model": {
                "$ref": "#/components/schemas/ModelRef"
              },
              "snapshot": {
                "type": "string"
              }
            },
            "required": ["timestamp", "sessionID", "assistantMessageID", "agent", "model"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionNextStepEnded": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.step.ended"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "assistantMessageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "finish": {
                "type": "string"
              },
              "cost": {
                "type": "number"
              },
              "tokens": {
                "type": "object",
                "properties": {
                  "input": {
                    "type": "number"
                  },
                  "output": {
                    "type": "number"
                  },
                  "reasoning": {
                    "type": "number"
                  },
                  "cache": {
                    "type": "object",
                    "properties": {
                      "read": {
                        "type": "number"
                      },
                      "write": {
                        "type": "number"
                      }
                    },
                    "required": ["read", "write"],
                    "additionalProperties": false
                  }
                },
                "required": ["input", "output", "reasoning", "cache"],
                "additionalProperties": false
              },
              "snapshot": {
                "type": "string"
              },
              "files": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": ["timestamp", "sessionID", "assistantMessageID", "finish", "cost", "tokens"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionNextStepFailed": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.step.failed"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "assistantMessageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "error": {
                "$ref": "#/components/schemas/SessionErrorUnknown"
              }
            },
            "required": ["timestamp", "sessionID", "assistantMessageID", "error"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionNextTextStarted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.text.started"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "assistantMessageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "textID": {
                "type": "string"
              }
            },
            "required": ["timestamp", "sessionID", "assistantMessageID", "textID"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionNextTextEnded": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.text.ended"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "assistantMessageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "textID": {
                "type": "string"
              },
              "text": {
                "type": "string"
              }
            },
            "required": ["timestamp", "sessionID", "assistantMessageID", "textID", "text"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionNextToolInputStarted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.tool.input.started"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "assistantMessageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "callID": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "name"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionNextToolInputEnded": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.tool.input.ended"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "assistantMessageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "callID": {
                "type": "string"
              },
              "text": {
                "type": "string"
              }
            },
            "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "text"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionNextToolCalled": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.tool.called"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "assistantMessageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "callID": {
                "type": "string"
              },
              "tool": {
                "type": "string"
              },
              "input": {
                "type": "object"
              },
              "provider": {
                "type": "object",
                "properties": {
                  "executed": {
                    "type": "boolean"
                  },
                  "metadata": {
                    "$ref": "#/components/schemas/LLMProviderMetadata"
                  }
                },
                "required": ["executed"],
                "additionalProperties": false
              }
            },
            "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "tool", "input", "provider"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionNextToolProgress": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.tool.progress"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "assistantMessageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "callID": {
                "type": "string"
              },
              "structured": {
                "type": "object"
              },
              "content": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/LLMToolContent"
                }
              }
            },
            "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "structured", "content"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionNextToolSuccess": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.tool.success"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "assistantMessageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "callID": {
                "type": "string"
              },
              "structured": {
                "type": "object"
              },
              "content": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/LLMToolContent"
                }
              },
              "outputPaths": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "result": {},
              "provider": {
                "type": "object",
                "properties": {
                  "executed": {
                    "type": "boolean"
                  },
                  "metadata": {
                    "$ref": "#/components/schemas/LLMProviderMetadata"
                  }
                },
                "required": ["executed"],
                "additionalProperties": false
              }
            },
            "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "structured", "content", "provider"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionNextToolFailed": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.tool.failed"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "assistantMessageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "callID": {
                "type": "string"
              },
              "error": {
                "$ref": "#/components/schemas/SessionErrorUnknown"
              },
              "result": {},
              "provider": {
                "type": "object",
                "properties": {
                  "executed": {
                    "type": "boolean"
                  },
                  "metadata": {
                    "$ref": "#/components/schemas/LLMProviderMetadata"
                  }
                },
                "required": ["executed"],
                "additionalProperties": false
              }
            },
            "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "error", "provider"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionNextReasoningStarted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.reasoning.started"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "assistantMessageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "reasoningID": {
                "type": "string"
              },
              "providerMetadata": {
                "$ref": "#/components/schemas/LLMProviderMetadata"
              }
            },
            "required": ["timestamp", "sessionID", "assistantMessageID", "reasoningID"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionNextReasoningEnded": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.reasoning.ended"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "assistantMessageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "reasoningID": {
                "type": "string"
              },
              "text": {
                "type": "string"
              },
              "providerMetadata": {
                "$ref": "#/components/schemas/LLMProviderMetadata"
              }
            },
            "required": ["timestamp", "sessionID", "assistantMessageID", "reasoningID", "text"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionNextRetried": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.retried"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "attempt": {
                "type": "number"
              },
              "error": {
                "$ref": "#/components/schemas/SessionNextRetry_error"
              }
            },
            "required": ["timestamp", "sessionID", "attempt", "error"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionNextCompactionStarted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.compaction.started"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "messageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "reason": {
                "type": "string",
                "enum": ["auto", "manual"]
              }
            },
            "required": ["timestamp", "sessionID", "messageID", "reason"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionNextCompactionEnded": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.compaction.ended"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "messageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "reason": {
                "type": "string",
                "enum": ["auto", "manual"]
              },
              "text": {
                "type": "string"
              },
              "recent": {
                "type": "string"
              }
            },
            "required": ["timestamp", "sessionID", "messageID", "reason", "text", "recent"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionNextRevertStaged": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.revert.staged"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "revert": {
                "$ref": "#/components/schemas/RevertState"
              }
            },
            "required": ["timestamp", "sessionID", "revert"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionNextRevertCleared": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.revert.cleared"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              }
            },
            "required": ["timestamp", "sessionID"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionNextRevertCommitted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.revert.committed"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "messageID": {
                "type": "string",
                "pattern": "^msg_"
              }
            },
            "required": ["timestamp", "sessionID", "messageID"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "ModelApi": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": ["aisdk"]
              },
              "package": {
                "type": "string"
              },
              "url": {
                "type": "string"
              },
              "settings": {
                "type": "object"
              }
            },
            "required": ["id", "type", "package"],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": ["native"]
              },
              "url": {
                "type": "string"
              },
              "settings": {
                "type": "object"
              }
            },
            "required": ["id", "type", "settings"],
            "additionalProperties": false
          }
        ]
      },
      "ModelCapabilities": {
        "type": "object",
        "properties": {
          "tools": {
            "type": "boolean"
          },
          "input": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "output": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": ["tools", "input", "output"],
        "additionalProperties": false
      },
      "ModelCost": {
        "type": "object",
        "properties": {
          "tier": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["context"]
              },
              "size": {
                "type": "integer"
              }
            },
            "required": ["type", "size"],
            "additionalProperties": false
          },
          "input": {
            "type": "number"
          },
          "output": {
            "type": "number"
          },
          "cache": {
            "type": "object",
            "properties": {
              "read": {
                "type": "number"
              },
              "write": {
                "type": "number"
              }
            },
            "required": ["read", "write"],
            "additionalProperties": false
          }
        },
        "required": ["input", "output", "cache"],
        "additionalProperties": false
      },
      "ModelV2Info": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "providerID": {
            "type": "string"
          },
          "family": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "api": {
            "$ref": "#/components/schemas/ModelApi"
          },
          "capabilities": {
            "$ref": "#/components/schemas/ModelCapabilities"
          },
          "request": {
            "type": "object",
            "properties": {
              "headers": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              },
              "body": {
                "type": "object"
              },
              "variant": {
                "type": "string"
              }
            },
            "required": ["headers", "body"],
            "additionalProperties": false
          },
          "variants": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "headers": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                },
                "body": {
                  "type": "object"
                }
              },
              "required": ["id", "headers", "body"],
              "additionalProperties": false
            }
          },
          "time": {
            "type": "object",
            "properties": {
              "released": {
                "type": "number"
              }
            },
            "required": ["released"],
            "additionalProperties": false
          },
          "cost": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModelCost"
            }
          },
          "status": {
            "type": "string",
            "enum": ["alpha", "beta", "deprecated", "active"]
          },
          "enabled": {
            "type": "boolean"
          },
          "limit": {
            "type": "object",
            "properties": {
              "context": {
                "type": "integer"
              },
              "input": {
                "type": "integer"
              },
              "output": {
                "type": "integer"
              }
            },
            "required": ["context", "output"],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "providerID",
          "name",
          "api",
          "capabilities",
          "request",
          "variants",
          "time",
          "cost",
          "status",
          "enabled",
          "limit"
        ],
        "additionalProperties": false
      },
      "ProviderAISDK": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["aisdk"]
          },
          "package": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "settings": {
            "type": "object"
          }
        },
        "required": ["type", "package"],
        "additionalProperties": false
      },
      "ProviderNative": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["native"]
          },
          "url": {
            "type": "string"
          },
          "settings": {
            "type": "object"
          }
        },
        "required": ["type", "settings"],
        "additionalProperties": false
      },
      "ProviderApi": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/ProviderAISDK"
          },
          {
            "$ref": "#/components/schemas/ProviderNative"
          }
        ]
      },
      "ProviderV2Info": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "integrationID": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "disabled": {
            "type": "boolean"
          },
          "api": {
            "$ref": "#/components/schemas/ProviderApi"
          },
          "request": {
            "$ref": "#/components/schemas/ProviderRequest"
          }
        },
        "required": ["id", "name", "api", "request"],
        "additionalProperties": false
      },
      "IntegrationWhen": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "op": {
            "type": "string",
            "enum": ["eq", "neq"]
          },
          "value": {
            "type": "string"
          }
        },
        "required": ["key", "op", "value"],
        "additionalProperties": false
      },
      "IntegrationTextPrompt": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["text"]
          },
          "key": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "placeholder": {
            "type": "string"
          },
          "when": {
            "$ref": "#/components/schemas/IntegrationWhen"
          }
        },
        "required": ["type", "key", "message"],
        "additionalProperties": false
      },
      "IntegrationSelectPrompt": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["select"]
          },
          "key": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "options": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                },
                "hint": {
                  "type": "string"
                }
              },
              "required": ["label", "value"],
              "additionalProperties": false
            }
          },
          "when": {
            "$ref": "#/components/schemas/IntegrationWhen"
          }
        },
        "required": ["type", "key", "message", "options"],
        "additionalProperties": false
      },
      "IntegrationOAuthMethod": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": ["oauth"]
          },
          "label": {
            "type": "string"
          },
          "prompts": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/IntegrationTextPrompt"
                },
                {
                  "$ref": "#/components/schemas/IntegrationSelectPrompt"
                }
              ]
            }
          }
        },
        "required": ["id", "type", "label"],
        "additionalProperties": false
      },
      "IntegrationKeyMethod": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["key"]
          },
          "label": {
            "type": "string"
          }
        },
        "required": ["type"],
        "additionalProperties": false
      },
      "IntegrationEnvMethod": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["env"]
          },
          "names": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": ["type", "names"],
        "additionalProperties": false
      },
      "ConnectionCredentialInfo": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["credential"]
          },
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          }
        },
        "required": ["type", "id", "label"],
        "additionalProperties": false
      },
      "ConnectionEnvInfo": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["env"]
          },
          "name": {
            "type": "string"
          }
        },
        "required": ["type", "name"],
        "additionalProperties": false
      },
      "ConnectionInfo": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/ConnectionCredentialInfo"
          },
          {
            "$ref": "#/components/schemas/ConnectionEnvInfo"
          }
        ]
      },
      "IntegrationInfo": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "methods": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntegrationMethod"
            }
          },
          "connections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConnectionInfo"
            }
          }
        },
        "required": ["id", "name", "methods", "connections"],
        "additionalProperties": false
      },
      "IntegrationAttempt": {
        "type": "object",
        "properties": {
          "attemptID": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "instructions": {
            "type": "string"
          },
          "mode": {
            "type": "string",
            "enum": ["auto", "code"]
          },
          "time": {
            "type": "object",
            "properties": {
              "created": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "enum": ["NaN"]
                  },
                  {
                    "type": "string",
                    "enum": ["Infinity"]
                  },
                  {
                    "type": "string",
                    "enum": ["-Infinity"]
                  },
                  {
                    "type": "string",
                    "enum": ["Infinity", "-Infinity", "NaN"]
                  }
                ]
              },
              "expires": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "enum": ["NaN"]
                  },
                  {
                    "type": "string",
                    "enum": ["Infinity"]
                  },
                  {
                    "type": "string",
                    "enum": ["-Infinity"]
                  },
                  {
                    "type": "string",
                    "enum": ["Infinity", "-Infinity", "NaN"]
                  }
                ]
              }
            },
            "required": ["created", "expires"],
            "additionalProperties": false
          }
        },
        "required": ["attemptID", "url", "instructions", "mode", "time"],
        "additionalProperties": false
      },
      "IntegrationAttemptStatus": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": ["pending"]
              },
              "time": {
                "type": "object",
                "properties": {
                  "created": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string",
                        "enum": ["NaN"]
                      },
                      {
                        "type": "string",
                        "enum": ["Infinity"]
                      },
                      {
                        "type": "string",
                        "enum": ["-Infinity"]
                      },
                      {
                        "type": "string",
                        "enum": ["Infinity", "-Infinity", "NaN"]
                      }
                    ]
                  },
                  "expires": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string",
                        "enum": ["NaN"]
                      },
                      {
                        "type": "string",
                        "enum": ["Infinity"]
                      },
                      {
                        "type": "string",
                        "enum": ["-Infinity"]
                      },
                      {
                        "type": "string",
                        "enum": ["Infinity", "-Infinity", "NaN"]
                      }
                    ]
                  }
                },
                "required": ["created", "expires"],
                "additionalProperties": false
              }
            },
            "required": ["status", "time"],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": ["complete"]
              },
              "time": {
                "type": "object",
                "properties": {
                  "created": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string",
                        "enum": ["NaN"]
                      },
                      {
                        "type": "string",
                        "enum": ["Infinity"]
                      },
                      {
                        "type": "string",
                        "enum": ["-Infinity"]
                      },
                      {
                        "type": "string",
                        "enum": ["Infinity", "-Infinity", "NaN"]
                      }
                    ]
                  },
                  "expires": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string",
                        "enum": ["NaN"]
                      },
                      {
                        "type": "string",
                        "enum": ["Infinity"]
                      },
                      {
                        "type": "string",
                        "enum": ["-Infinity"]
                      },
                      {
                        "type": "string",
                        "enum": ["Infinity", "-Infinity", "NaN"]
                      }
                    ]
                  }
                },
                "required": ["created", "expires"],
                "additionalProperties": false
              }
            },
            "required": ["status", "time"],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": ["failed"]
              },
              "message": {
                "type": "string"
              },
              "time": {
                "type": "object",
                "properties": {
                  "created": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string",
                        "enum": ["NaN"]
                      },
                      {
                        "type": "string",
                        "enum": ["Infinity"]
                      },
                      {
                        "type": "string",
                        "enum": ["-Infinity"]
                      },
                      {
                        "type": "string",
                        "enum": ["Infinity", "-Infinity", "NaN"]
                      }
                    ]
                  },
                  "expires": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string",
                        "enum": ["NaN"]
                      },
                      {
                        "type": "string",
                        "enum": ["Infinity"]
                      },
                      {
                        "type": "string",
                        "enum": ["-Infinity"]
                      },
                      {
                        "type": "string",
                        "enum": ["Infinity", "-Infinity", "NaN"]
                      }
                    ]
                  }
                },
                "required": ["created", "expires"],
                "additionalProperties": false
              }
            },
            "required": ["status", "message", "time"],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": ["expired"]
              },
              "time": {
                "type": "object",
                "properties": {
                  "created": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string",
                        "enum": ["NaN"]
                      },
                      {
                        "type": "string",
                        "enum": ["Infinity"]
                      },
                      {
                        "type": "string",
                        "enum": ["-Infinity"]
                      },
                      {
                        "type": "string",
                        "enum": ["Infinity", "-Infinity", "NaN"]
                      }
                    ]
                  },
                  "expires": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string",
                        "enum": ["NaN"]
                      },
                      {
                        "type": "string",
                        "enum": ["Infinity"]
                      },
                      {
                        "type": "string",
                        "enum": ["-Infinity"]
                      },
                      {
                        "type": "string",
                        "enum": ["Infinity", "-Infinity", "NaN"]
                      }
                    ]
                  }
                },
                "required": ["created", "expires"],
                "additionalProperties": false
              }
            },
            "required": ["status", "time"],
            "additionalProperties": false
          }
        ]
      },
      "PermissionV2Request": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^per"
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses"
          },
          "action": {
            "type": "string"
          },
          "resources": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "save": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "metadata": {
            "type": "object"
          },
          "source": {
            "$ref": "#/components/schemas/PermissionV2Source"
          }
        },
        "required": ["id", "sessionID", "action", "resources"],
        "additionalProperties": false
      },
      "PermissionSavedInfo": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "projectID": {
            "type": "string"
          },
          "action": {
            "type": "string"
          },
          "resource": {
            "type": "string"
          }
        },
        "required": ["id", "projectID", "action", "resource"],
        "additionalProperties": false
      },
      "FileSystemEntry": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": ["file", "directory"]
          }
        },
        "required": ["path", "type"],
        "additionalProperties": false
      },
      "CommandV2Info": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "template": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "agent": {
            "type": "string"
          },
          "model": {
            "$ref": "#/components/schemas/ModelRef"
          },
          "subtask": {
            "type": "boolean"
          }
        },
        "required": ["name", "template"],
        "additionalProperties": false
      },
      "SkillV2Info": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "slash": {
            "type": "boolean"
          },
          "location": {
            "type": "string"
          },
          "content": {
            "type": "string"
          }
        },
        "required": ["name", "location", "content"],
        "additionalProperties": false
      },
      "Models-devRefreshed": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["models-dev.refreshed"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {}
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "IntegrationUpdated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["integration.updated"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {}
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "IntegrationConnectionUpdated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["integration.connection.updated"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "integrationID": {
                "type": "string"
              }
            },
            "required": ["integrationID"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "CatalogUpdated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["catalog.updated"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {}
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionCreated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.created"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "info": {
                "$ref": "#/components/schemas/Session"
              }
            },
            "required": ["sessionID", "info"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionUpdated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.updated"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "info": {
                "$ref": "#/components/schemas/Session"
              }
            },
            "required": ["sessionID", "info"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionDeleted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.deleted"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "info": {
                "$ref": "#/components/schemas/Session"
              }
            },
            "required": ["sessionID", "info"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "MessageUpdated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["message.updated"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "info": {
                "$ref": "#/components/schemas/Message"
              }
            },
            "required": ["sessionID", "info"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "MessageRemoved": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["message.removed"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "messageID": {
                "type": "string",
                "pattern": "^msg"
              }
            },
            "required": ["sessionID", "messageID"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "MessagePartUpdated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["message.part.updated"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "part": {
                "$ref": "#/components/schemas/Part"
              },
              "time": {
                "type": "number"
              }
            },
            "required": ["sessionID", "part", "time"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "MessagePartRemoved": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["message.part.removed"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "messageID": {
                "type": "string",
                "pattern": "^msg"
              },
              "partID": {
                "type": "string",
                "pattern": "^prt"
              }
            },
            "required": ["sessionID", "messageID", "partID"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionNextTextDelta": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.text.delta"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "assistantMessageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "textID": {
                "type": "string"
              },
              "delta": {
                "type": "string"
              }
            },
            "required": ["timestamp", "sessionID", "assistantMessageID", "textID", "delta"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionNextReasoningDelta": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.reasoning.delta"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "assistantMessageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "reasoningID": {
                "type": "string"
              },
              "delta": {
                "type": "string"
              }
            },
            "required": ["timestamp", "sessionID", "assistantMessageID", "reasoningID", "delta"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionNextToolInputDelta": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.tool.input.delta"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "assistantMessageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "callID": {
                "type": "string"
              },
              "delta": {
                "type": "string"
              }
            },
            "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "delta"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionNextCompactionDelta": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.compaction.delta"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "messageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "text": {
                "type": "string"
              }
            },
            "required": ["timestamp", "sessionID", "messageID", "text"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "MessagePartDelta": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["message.part.delta"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "messageID": {
                "type": "string",
                "pattern": "^msg"
              },
              "partID": {
                "type": "string",
                "pattern": "^prt"
              },
              "field": {
                "type": "string"
              },
              "delta": {
                "type": "string"
              }
            },
            "required": ["sessionID", "messageID", "partID", "field", "delta"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionDiff": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.diff"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "diff": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SnapshotFileDiff"
                }
              }
            },
            "required": ["sessionID", "diff"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionError": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.error"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "error": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ProviderAuthError"
                  },
                  {
                    "$ref": "#/components/schemas/UnknownError"
                  },
                  {
                    "$ref": "#/components/schemas/MessageOutputLengthError"
                  },
                  {
                    "$ref": "#/components/schemas/MessageAbortedError"
                  },
                  {
                    "$ref": "#/components/schemas/StructuredOutputError"
                  },
                  {
                    "$ref": "#/components/schemas/ContextOverflowError"
                  },
                  {
                    "$ref": "#/components/schemas/ContentFilterError"
                  },
                  {
                    "$ref": "#/components/schemas/APIError"
                  }
                ]
              }
            },
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "InstallationUpdated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["installation.updated"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "version": {
                "type": "string"
              }
            },
            "required": ["version"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "InstallationUpdate-available": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["installation.update-available"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "version": {
                "type": "string"
              }
            },
            "required": ["version"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "FileEdited": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["file.edited"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "file": {
                "type": "string"
              }
            },
            "required": ["file"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "ReferenceUpdated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["reference.updated"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {}
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "PermissionV2Asked": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["permission.v2.asked"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^per"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "action": {
                "type": "string"
              },
              "resources": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "save": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "metadata": {
                "type": "object"
              },
              "source": {
                "$ref": "#/components/schemas/PermissionV2Source"
              }
            },
            "required": ["id", "sessionID", "action", "resources"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "PermissionV2Replied": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["permission.v2.replied"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "requestID": {
                "type": "string",
                "pattern": "^per"
              },
              "reply": {
                "$ref": "#/components/schemas/PermissionV2Reply"
              }
            },
            "required": ["sessionID", "requestID", "reply"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "PluginAdded": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["plugin.added"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              }
            },
            "required": ["id"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "ProjectDirectoriesUpdated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["project.directories.updated"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "projectID": {
                "type": "string"
              }
            },
            "required": ["projectID"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "FileWatcherUpdated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["file.watcher.updated"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "file": {
                "type": "string"
              },
              "event": {
                "type": "string",
                "enum": ["add", "change", "unlink"]
              }
            },
            "required": ["file", "event"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "PtyCreated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["pty.created"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "info": {
                "$ref": "#/components/schemas/Pty"
              }
            },
            "required": ["info"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "PtyUpdated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["pty.updated"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "info": {
                "$ref": "#/components/schemas/Pty"
              }
            },
            "required": ["info"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "PtyExited": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["pty.exited"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^pty"
              },
              "exitCode": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": ["id", "exitCode"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "PtyDeleted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["pty.deleted"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^pty"
              }
            },
            "required": ["id"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "QuestionV2Asked": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["question.v2.asked"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^que"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "questions": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/QuestionV2Info"
                },
                "description": "Questions to ask"
              },
              "tool": {
                "$ref": "#/components/schemas/QuestionV2Tool"
              }
            },
            "required": ["id", "sessionID", "questions"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "QuestionV2Replied": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["question.v2.replied"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "requestID": {
                "type": "string",
                "pattern": "^que"
              },
              "answers": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/QuestionV2Answer"
                }
              }
            },
            "required": ["sessionID", "requestID", "answers"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "QuestionV2Rejected": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["question.v2.rejected"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "requestID": {
                "type": "string",
                "pattern": "^que"
              }
            },
            "required": ["sessionID", "requestID"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "LspUpdated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["lsp.updated"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {}
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "PermissionAsked": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["permission.asked"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^per"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "permission": {
                "type": "string"
              },
              "patterns": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "metadata": {
                "type": "object"
              },
              "always": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "tool": {
                "type": "object",
                "properties": {
                  "messageID": {
                    "type": "string"
                  },
                  "callID": {
                    "type": "string"
                  }
                },
                "required": ["messageID", "callID"],
                "additionalProperties": false
              }
            },
            "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "PermissionReplied": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["permission.replied"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "requestID": {
                "type": "string",
                "pattern": "^per"
              },
              "reply": {
                "type": "string",
                "enum": ["once", "always", "reject"]
              }
            },
            "required": ["sessionID", "requestID", "reply"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "TuiPromptAppend": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["tui.prompt.append"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              }
            },
            "required": ["text"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "TuiCommandExecute": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["tui.command.execute"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "command": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "session.list",
                      "session.new",
                      "session.share",
                      "session.interrupt",
                      "session.compact",
                      "session.page.up",
                      "session.page.down",
                      "session.line.up",
                      "session.line.down",
                      "session.half.page.up",
                      "session.half.page.down",
                      "session.first",
                      "session.last",
                      "prompt.clear",
                      "prompt.submit",
                      "agent.cycle"
                    ]
                  },
                  {
                    "type": "string"
                  }
                ]
              }
            },
            "required": ["command"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "TuiToastShow": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["tui.toast.show"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "title": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "variant": {
                "type": "string",
                "enum": ["info", "success", "warning", "error"]
              },
              "duration": {
                "type": "integer",
                "exclusiveMinimum": 0
              }
            },
            "required": ["message", "variant"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "TuiSessionSelect": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["tui.session.select"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses",
                "description": "Session ID to navigate to"
              }
            },
            "required": ["sessionID"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "McpToolsChanged": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["mcp.tools.changed"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "server": {
                "type": "string"
              }
            },
            "required": ["server"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "McpBrowserOpenFailed": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["mcp.browser.open.failed"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "mcpName": {
                "type": "string"
              },
              "url": {
                "type": "string"
              }
            },
            "required": ["mcpName", "url"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "CommandExecuted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["command.executed"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "arguments": {
                "type": "string"
              },
              "messageID": {
                "type": "string",
                "pattern": "^msg"
              }
            },
            "required": ["name", "sessionID", "arguments", "messageID"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "ProjectUpdated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["project.updated"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "worktree": {
                "type": "string"
              },
              "vcs": {
                "$ref": "#/components/schemas/ProjectVcs"
              },
              "name": {
                "type": "string"
              },
              "icon": {
                "$ref": "#/components/schemas/ProjectIcon"
              },
              "commands": {
                "$ref": "#/components/schemas/ProjectCommands"
              },
              "time": {
                "$ref": "#/components/schemas/ProjectTime"
              },
              "sandboxes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": ["id", "worktree", "time", "sandboxes"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionIdle": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.idle"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              }
            },
            "required": ["sessionID"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "QuestionAsked": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["question.asked"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^que"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "questions": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/QuestionInfo"
                },
                "description": "Questions to ask"
              },
              "tool": {
                "$ref": "#/components/schemas/QuestionTool"
              }
            },
            "required": ["id", "sessionID", "questions"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "SessionCompacted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["session.compacted"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              }
            },
            "required": ["sessionID"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "VcsBranchUpdated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["vcs.branch.updated"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "branch": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "WorkspaceReady": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["workspace.ready"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              }
            },
            "required": ["name"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "WorkspaceFailed": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["workspace.failed"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              }
            },
            "required": ["message"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "WorkspaceStatus": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["workspace.status"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "workspaceID": {
                "type": "string",
                "pattern": "^wrk"
              },
              "status": {
                "type": "string",
                "enum": ["connected", "connecting", "disconnected", "error"]
              }
            },
            "required": ["workspaceID", "status"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "WorktreeReady": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["worktree.ready"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "branch": {
                "type": "string"
              }
            },
            "required": ["name"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "WorktreeFailed": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["worktree.failed"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              }
            },
            "required": ["message"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "ServerConnected": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["server.connected"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {}
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "GlobalDisposed": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "metadata": {
            "type": "object"
          },
          "type": {
            "type": "string",
            "enum": ["global.disposed"]
          },
          "durable": {
            "type": "object",
            "properties": {
              "aggregateID": {
                "type": "string"
              },
              "seq": {
                "type": "integer"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": ["aggregateID", "seq", "version"],
            "additionalProperties": false
          },
          "location": {
            "$ref": "#/components/schemas/LocationRef"
          },
          "data": {
            "type": "object",
            "properties": {}
          }
        },
        "required": ["id", "type", "data"],
        "additionalProperties": false
      },
      "QuestionV2Request": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^que"
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses"
          },
          "questions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuestionV2Info"
            },
            "description": "Questions to ask"
          },
          "tool": {
            "$ref": "#/components/schemas/QuestionV2Tool"
          }
        },
        "required": ["id", "sessionID", "questions"],
        "additionalProperties": false
      },
      "QuestionV2Reply": {
        "type": "object",
        "properties": {
          "answers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuestionV2Answer"
            },
            "description": "User answers in order of questions (each answer is an array of selected labels)"
          }
        },
        "required": ["answers"],
        "additionalProperties": false
      },
      "ReferenceLocalSource": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["local"]
          },
          "path": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "hidden": {
            "type": "boolean"
          }
        },
        "required": ["type", "path"],
        "additionalProperties": false
      },
      "ReferenceGitSource": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["git"]
          },
          "repository": {
            "type": "string"
          },
          "branch": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "hidden": {
            "type": "boolean"
          }
        },
        "required": ["type", "repository"],
        "additionalProperties": false
      },
      "ReferenceSource": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/ReferenceLocalSource"
          },
          {
            "$ref": "#/components/schemas/ReferenceGitSource"
          }
        ]
      },
      "ReferenceInfo": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "hidden": {
            "type": "boolean"
          },
          "source": {
            "$ref": "#/components/schemas/ReferenceSource"
          }
        },
        "required": ["name", "path", "source"],
        "additionalProperties": false
      },
      "ProjectCopyCopy": {
        "type": "object",
        "properties": {
          "directory": {
            "type": "string"
          }
        },
        "required": ["directory"],
        "additionalProperties": false
      },
      "EventModels-devRefreshed": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["models-dev.refreshed"]
          },
          "properties": {
            "type": "object",
            "properties": {}
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventIntegrationUpdated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["integration.updated"]
          },
          "properties": {
            "type": "object",
            "properties": {}
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventIntegrationConnectionUpdated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["integration.connection.updated"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "integrationID": {
                "type": "string"
              }
            },
            "required": ["integrationID"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventCatalogUpdated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["catalog.updated"]
          },
          "properties": {
            "type": "object",
            "properties": {}
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionCreated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.created"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "info": {
                "$ref": "#/components/schemas/Session"
              }
            },
            "required": ["sessionID", "info"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionUpdated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.updated"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "info": {
                "$ref": "#/components/schemas/Session"
              }
            },
            "required": ["sessionID", "info"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionDeleted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.deleted"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "info": {
                "$ref": "#/components/schemas/Session"
              }
            },
            "required": ["sessionID", "info"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventMessageUpdated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["message.updated"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "info": {
                "$ref": "#/components/schemas/Message"
              }
            },
            "required": ["sessionID", "info"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventMessageRemoved": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["message.removed"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "messageID": {
                "type": "string",
                "pattern": "^msg"
              }
            },
            "required": ["sessionID", "messageID"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventMessagePartUpdated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["message.part.updated"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "part": {
                "$ref": "#/components/schemas/Part"
              },
              "time": {
                "type": "number"
              }
            },
            "required": ["sessionID", "part", "time"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventMessagePartRemoved": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["message.part.removed"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "messageID": {
                "type": "string",
                "pattern": "^msg"
              },
              "partID": {
                "type": "string",
                "pattern": "^prt"
              }
            },
            "required": ["sessionID", "messageID", "partID"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionNextAgentSwitched": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.agent.switched"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "messageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "agent": {
                "type": "string"
              }
            },
            "required": ["timestamp", "sessionID", "messageID", "agent"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionNextModelSwitched": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.model.switched"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "messageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "model": {
                "$ref": "#/components/schemas/ModelRef"
              }
            },
            "required": ["timestamp", "sessionID", "messageID", "model"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionNextMoved": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.moved"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "location": {
                "$ref": "#/components/schemas/LocationRef"
              },
              "subdirectory": {
                "type": "string"
              }
            },
            "required": ["timestamp", "sessionID", "location"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionNextPrompted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.prompted"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "messageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "prompt": {
                "$ref": "#/components/schemas/Prompt"
              },
              "delivery": {
                "type": "string",
                "enum": ["steer", "queue"]
              }
            },
            "required": ["timestamp", "sessionID", "messageID", "prompt", "delivery"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionNextPromptAdmitted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.prompt.admitted"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "messageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "prompt": {
                "$ref": "#/components/schemas/Prompt"
              },
              "delivery": {
                "type": "string",
                "enum": ["steer", "queue"]
              }
            },
            "required": ["timestamp", "sessionID", "messageID", "prompt", "delivery"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionNextContextUpdated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.context.updated"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "messageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "text": {
                "type": "string"
              }
            },
            "required": ["timestamp", "sessionID", "messageID", "text"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionNextSynthetic": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.synthetic"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "messageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "text": {
                "type": "string"
              }
            },
            "required": ["timestamp", "sessionID", "messageID", "text"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionNextShellStarted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.shell.started"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "messageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "callID": {
                "type": "string"
              },
              "command": {
                "type": "string"
              }
            },
            "required": ["timestamp", "sessionID", "messageID", "callID", "command"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionNextShellEnded": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.shell.ended"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "callID": {
                "type": "string"
              },
              "output": {
                "type": "string"
              }
            },
            "required": ["timestamp", "sessionID", "callID", "output"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionNextStepStarted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.step.started"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "assistantMessageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "agent": {
                "type": "string"
              },
              "model": {
                "$ref": "#/components/schemas/ModelRef"
              },
              "snapshot": {
                "type": "string"
              }
            },
            "required": ["timestamp", "sessionID", "assistantMessageID", "agent", "model"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionNextStepEnded": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.step.ended"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "assistantMessageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "finish": {
                "type": "string"
              },
              "cost": {
                "type": "number"
              },
              "tokens": {
                "type": "object",
                "properties": {
                  "input": {
                    "type": "number"
                  },
                  "output": {
                    "type": "number"
                  },
                  "reasoning": {
                    "type": "number"
                  },
                  "cache": {
                    "type": "object",
                    "properties": {
                      "read": {
                        "type": "number"
                      },
                      "write": {
                        "type": "number"
                      }
                    },
                    "required": ["read", "write"],
                    "additionalProperties": false
                  }
                },
                "required": ["input", "output", "reasoning", "cache"],
                "additionalProperties": false
              },
              "snapshot": {
                "type": "string"
              },
              "files": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": ["timestamp", "sessionID", "assistantMessageID", "finish", "cost", "tokens"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionNextStepFailed": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.step.failed"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "assistantMessageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "error": {
                "$ref": "#/components/schemas/SessionErrorUnknown"
              }
            },
            "required": ["timestamp", "sessionID", "assistantMessageID", "error"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionNextTextStarted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.text.started"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "assistantMessageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "textID": {
                "type": "string"
              }
            },
            "required": ["timestamp", "sessionID", "assistantMessageID", "textID"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionNextTextDelta": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.text.delta"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "assistantMessageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "textID": {
                "type": "string"
              },
              "delta": {
                "type": "string"
              }
            },
            "required": ["timestamp", "sessionID", "assistantMessageID", "textID", "delta"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionNextTextEnded": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.text.ended"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "assistantMessageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "textID": {
                "type": "string"
              },
              "text": {
                "type": "string"
              }
            },
            "required": ["timestamp", "sessionID", "assistantMessageID", "textID", "text"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionNextReasoningStarted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.reasoning.started"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "assistantMessageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "reasoningID": {
                "type": "string"
              },
              "providerMetadata": {
                "$ref": "#/components/schemas/LLMProviderMetadata"
              }
            },
            "required": ["timestamp", "sessionID", "assistantMessageID", "reasoningID"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionNextReasoningDelta": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.reasoning.delta"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "assistantMessageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "reasoningID": {
                "type": "string"
              },
              "delta": {
                "type": "string"
              }
            },
            "required": ["timestamp", "sessionID", "assistantMessageID", "reasoningID", "delta"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionNextReasoningEnded": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.reasoning.ended"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "assistantMessageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "reasoningID": {
                "type": "string"
              },
              "text": {
                "type": "string"
              },
              "providerMetadata": {
                "$ref": "#/components/schemas/LLMProviderMetadata"
              }
            },
            "required": ["timestamp", "sessionID", "assistantMessageID", "reasoningID", "text"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionNextToolInputStarted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.tool.input.started"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "assistantMessageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "callID": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "name"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionNextToolInputDelta": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.tool.input.delta"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "assistantMessageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "callID": {
                "type": "string"
              },
              "delta": {
                "type": "string"
              }
            },
            "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "delta"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionNextToolInputEnded": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.tool.input.ended"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "assistantMessageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "callID": {
                "type": "string"
              },
              "text": {
                "type": "string"
              }
            },
            "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "text"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionNextToolCalled": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.tool.called"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "assistantMessageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "callID": {
                "type": "string"
              },
              "tool": {
                "type": "string"
              },
              "input": {
                "type": "object"
              },
              "provider": {
                "type": "object",
                "properties": {
                  "executed": {
                    "type": "boolean"
                  },
                  "metadata": {
                    "$ref": "#/components/schemas/LLMProviderMetadata"
                  }
                },
                "required": ["executed"],
                "additionalProperties": false
              }
            },
            "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "tool", "input", "provider"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionNextToolProgress": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.tool.progress"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "assistantMessageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "callID": {
                "type": "string"
              },
              "structured": {
                "type": "object"
              },
              "content": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/LLMToolContent"
                }
              }
            },
            "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "structured", "content"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionNextToolSuccess": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.tool.success"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "assistantMessageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "callID": {
                "type": "string"
              },
              "structured": {
                "type": "object"
              },
              "content": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/LLMToolContent"
                }
              },
              "outputPaths": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "result": {},
              "provider": {
                "type": "object",
                "properties": {
                  "executed": {
                    "type": "boolean"
                  },
                  "metadata": {
                    "$ref": "#/components/schemas/LLMProviderMetadata"
                  }
                },
                "required": ["executed"],
                "additionalProperties": false
              }
            },
            "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "structured", "content", "provider"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionNextToolFailed": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.tool.failed"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "assistantMessageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "callID": {
                "type": "string"
              },
              "error": {
                "$ref": "#/components/schemas/SessionErrorUnknown"
              },
              "result": {},
              "provider": {
                "type": "object",
                "properties": {
                  "executed": {
                    "type": "boolean"
                  },
                  "metadata": {
                    "$ref": "#/components/schemas/LLMProviderMetadata"
                  }
                },
                "required": ["executed"],
                "additionalProperties": false
              }
            },
            "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "error", "provider"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionNextRetried": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.retried"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "attempt": {
                "type": "number"
              },
              "error": {
                "$ref": "#/components/schemas/SessionNextRetry_error"
              }
            },
            "required": ["timestamp", "sessionID", "attempt", "error"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionNextCompactionStarted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.compaction.started"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "messageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "reason": {
                "type": "string",
                "enum": ["auto", "manual"]
              }
            },
            "required": ["timestamp", "sessionID", "messageID", "reason"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionNextCompactionDelta": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.compaction.delta"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "messageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "text": {
                "type": "string"
              }
            },
            "required": ["timestamp", "sessionID", "messageID", "text"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionNextCompactionEnded": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.compaction.ended"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "messageID": {
                "type": "string",
                "pattern": "^msg_"
              },
              "reason": {
                "type": "string",
                "enum": ["auto", "manual"]
              },
              "text": {
                "type": "string"
              },
              "recent": {
                "type": "string"
              }
            },
            "required": ["timestamp", "sessionID", "messageID", "reason", "text", "recent"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionNextRevertStaged": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.revert.staged"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "revert": {
                "$ref": "#/components/schemas/RevertState"
              }
            },
            "required": ["timestamp", "sessionID", "revert"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionNextRevertCleared": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.revert.cleared"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              }
            },
            "required": ["timestamp", "sessionID"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionNextRevertCommitted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.next.revert.committed"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "timestamp": {
                "type": "number"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "messageID": {
                "type": "string",
                "pattern": "^msg_"
              }
            },
            "required": ["timestamp", "sessionID", "messageID"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventMessagePartDelta": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["message.part.delta"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "messageID": {
                "type": "string",
                "pattern": "^msg"
              },
              "partID": {
                "type": "string",
                "pattern": "^prt"
              },
              "field": {
                "type": "string"
              },
              "delta": {
                "type": "string"
              }
            },
            "required": ["sessionID", "messageID", "partID", "field", "delta"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionDiff": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.diff"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "diff": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SnapshotFileDiff"
                }
              }
            },
            "required": ["sessionID", "diff"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionError": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.error"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "error": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ProviderAuthError"
                  },
                  {
                    "$ref": "#/components/schemas/UnknownError"
                  },
                  {
                    "$ref": "#/components/schemas/MessageOutputLengthError"
                  },
                  {
                    "$ref": "#/components/schemas/MessageAbortedError"
                  },
                  {
                    "$ref": "#/components/schemas/StructuredOutputError"
                  },
                  {
                    "$ref": "#/components/schemas/ContextOverflowError"
                  },
                  {
                    "$ref": "#/components/schemas/ContentFilterError"
                  },
                  {
                    "$ref": "#/components/schemas/APIError"
                  }
                ]
              }
            },
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventInstallationUpdated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["installation.updated"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "version": {
                "type": "string"
              }
            },
            "required": ["version"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventInstallationUpdate-available": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["installation.update-available"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "version": {
                "type": "string"
              }
            },
            "required": ["version"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventFileEdited": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["file.edited"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "file": {
                "type": "string"
              }
            },
            "required": ["file"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventReferenceUpdated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["reference.updated"]
          },
          "properties": {
            "type": "object",
            "properties": {}
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventPermissionV2Asked": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["permission.v2.asked"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^per"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "action": {
                "type": "string"
              },
              "resources": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "save": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "metadata": {
                "type": "object"
              },
              "source": {
                "$ref": "#/components/schemas/PermissionV2Source"
              }
            },
            "required": ["id", "sessionID", "action", "resources"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventPermissionV2Replied": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["permission.v2.replied"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "requestID": {
                "type": "string",
                "pattern": "^per"
              },
              "reply": {
                "$ref": "#/components/schemas/PermissionV2Reply"
              }
            },
            "required": ["sessionID", "requestID", "reply"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventPluginAdded": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["plugin.added"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              }
            },
            "required": ["id"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventProjectDirectoriesUpdated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["project.directories.updated"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "projectID": {
                "type": "string"
              }
            },
            "required": ["projectID"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventFileWatcherUpdated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["file.watcher.updated"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "file": {
                "type": "string"
              },
              "event": {
                "type": "string",
                "enum": ["add", "change", "unlink"]
              }
            },
            "required": ["file", "event"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventPtyCreated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["pty.created"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "info": {
                "$ref": "#/components/schemas/Pty"
              }
            },
            "required": ["info"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventPtyUpdated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["pty.updated"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "info": {
                "$ref": "#/components/schemas/Pty"
              }
            },
            "required": ["info"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventPtyExited": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["pty.exited"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^pty"
              },
              "exitCode": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": ["id", "exitCode"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventPtyDeleted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["pty.deleted"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^pty"
              }
            },
            "required": ["id"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventQuestionV2Asked": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["question.v2.asked"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^que"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "questions": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/QuestionV2Info"
                },
                "description": "Questions to ask"
              },
              "tool": {
                "$ref": "#/components/schemas/QuestionV2Tool"
              }
            },
            "required": ["id", "sessionID", "questions"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventQuestionV2Replied": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["question.v2.replied"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "requestID": {
                "type": "string",
                "pattern": "^que"
              },
              "answers": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/QuestionV2Answer"
                }
              }
            },
            "required": ["sessionID", "requestID", "answers"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventQuestionV2Rejected": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["question.v2.rejected"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "requestID": {
                "type": "string",
                "pattern": "^que"
              }
            },
            "required": ["sessionID", "requestID"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventLspUpdated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["lsp.updated"]
          },
          "properties": {
            "type": "object",
            "properties": {}
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventPermissionAsked": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["permission.asked"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^per"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "permission": {
                "type": "string"
              },
              "patterns": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "metadata": {
                "type": "object"
              },
              "always": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "tool": {
                "type": "object",
                "properties": {
                  "messageID": {
                    "type": "string"
                  },
                  "callID": {
                    "type": "string"
                  }
                },
                "required": ["messageID", "callID"],
                "additionalProperties": false
              }
            },
            "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventPermissionReplied": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["permission.replied"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "requestID": {
                "type": "string",
                "pattern": "^per"
              },
              "reply": {
                "type": "string",
                "enum": ["once", "always", "reject"]
              }
            },
            "required": ["sessionID", "requestID", "reply"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventMcpToolsChanged": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["mcp.tools.changed"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "server": {
                "type": "string"
              }
            },
            "required": ["server"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventMcpBrowserOpenFailed": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["mcp.browser.open.failed"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "mcpName": {
                "type": "string"
              },
              "url": {
                "type": "string"
              }
            },
            "required": ["mcpName", "url"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventCommandExecuted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["command.executed"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "arguments": {
                "type": "string"
              },
              "messageID": {
                "type": "string",
                "pattern": "^msg"
              }
            },
            "required": ["name", "sessionID", "arguments", "messageID"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventProjectUpdated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["project.updated"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "worktree": {
                "type": "string"
              },
              "vcs": {
                "$ref": "#/components/schemas/ProjectVcs"
              },
              "name": {
                "type": "string"
              },
              "icon": {
                "$ref": "#/components/schemas/ProjectIcon"
              },
              "commands": {
                "$ref": "#/components/schemas/ProjectCommands"
              },
              "time": {
                "$ref": "#/components/schemas/ProjectTime"
              },
              "sandboxes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": ["id", "worktree", "time", "sandboxes"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionStatus": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.status"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "status": {
                "$ref": "#/components/schemas/SessionStatus"
              }
            },
            "required": ["sessionID", "status"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionIdle": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.idle"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              }
            },
            "required": ["sessionID"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventQuestionAsked": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["question.asked"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^que"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "questions": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/QuestionInfo"
                },
                "description": "Questions to ask"
              },
              "tool": {
                "$ref": "#/components/schemas/QuestionTool"
              }
            },
            "required": ["id", "sessionID", "questions"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventQuestionReplied": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["question.replied"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "requestID": {
                "type": "string",
                "pattern": "^que"
              },
              "answers": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/QuestionAnswer"
                }
              }
            },
            "required": ["sessionID", "requestID", "answers"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventQuestionRejected": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["question.rejected"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              },
              "requestID": {
                "type": "string",
                "pattern": "^que"
              }
            },
            "required": ["sessionID", "requestID"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventSessionCompacted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["session.compacted"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses"
              }
            },
            "required": ["sessionID"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventVcsBranchUpdated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["vcs.branch.updated"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "branch": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventWorkspaceReady": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["workspace.ready"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              }
            },
            "required": ["name"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventWorkspaceFailed": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["workspace.failed"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              }
            },
            "required": ["message"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventWorkspaceStatus": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["workspace.status"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "workspaceID": {
                "type": "string",
                "pattern": "^wrk"
              },
              "status": {
                "type": "string",
                "enum": ["connected", "connecting", "disconnected", "error"]
              }
            },
            "required": ["workspaceID", "status"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventWorktreeReady": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["worktree.ready"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "branch": {
                "type": "string"
              }
            },
            "required": ["name"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventWorktreeFailed": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["worktree.failed"]
          },
          "properties": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              }
            },
            "required": ["message"],
            "additionalProperties": false
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventServerConnected": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["server.connected"]
          },
          "properties": {
            "type": "object",
            "properties": {}
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "EventGlobalDisposed": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_"
          },
          "type": {
            "type": "string",
            "enum": ["global.disposed"]
          },
          "properties": {
            "type": "object",
            "properties": {}
          }
        },
        "required": ["id", "type", "properties"],
        "additionalProperties": false
      },
      "CredentialOAuth": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["oauth"]
          },
          "methodID": {
            "type": "string"
          },
          "refresh": {
            "type": "string"
          },
          "access": {
            "type": "string"
          },
          "expires": {
            "type": "integer",
            "minimum": 0
          },
          "metadata": {
            "type": "object"
          }
        },
        "required": ["type", "methodID", "refresh", "access", "expires"],
        "additionalProperties": false
      },
      "CredentialKey": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["key"]
          },
          "key": {
            "type": "string"
          },
          "metadata": {
            "type": "object"
          }
        },
        "required": ["type", "key"],
        "additionalProperties": false
      },
      "SkillV2DirectorySource": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["directory"]
          },
          "path": {
            "type": "string"
          }
        },
        "required": ["type", "path"],
        "additionalProperties": false
      },
      "SkillV2UrlSource": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["url"]
          },
          "url": {
            "type": "string"
          }
        },
        "required": ["type", "url"],
        "additionalProperties": false
      },
      "SkillV2EmbeddedSource": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["embedded"]
          },
          "skill": {
            "$ref": "#/components/schemas/SkillV2Info"
          }
        },
        "required": ["type", "skill"],
        "additionalProperties": false
      },
      "BadRequestError": {
        "type": "object",
        "required": ["name", "data"],
        "properties": {
          "name": {
            "type": "string",
            "enum": ["BadRequest"]
          },
          "data": {
            "type": "object",
            "required": ["message"],
            "properties": {
              "message": {
                "type": "string"
              },
              "kind": {
                "type": "string",
                "enum": ["Params", "Headers", "Query", "Body", "Payload"]
              }
            }
          }
        }
      }
    }
  },
  "security": [],
  "tags": [
    {
      "name": "control",
      "description": "Control plane routes."
    },
    {
      "name": "controlPlane",
      "description": "Control-plane orchestration routes."
    },
    {
      "name": "global",
      "description": "Global server routes."
    },
    {
      "name": "event",
      "description": "Instance event stream route."
    },
    {
      "name": "config",
      "description": "Experimental HttpApi config routes."
    },
    {
      "name": "experimental",
      "description": "Experimental HttpApi read-only routes."
    },
    {
      "name": "file",
      "description": "Experimental HttpApi file routes."
    },
    {
      "name": "instance",
      "description": "Experimental HttpApi instance read routes."
    },
    {
      "name": "mcp",
      "description": "Experimental HttpApi MCP routes."
    },
    {
      "name": "project",
      "description": "Experimental HttpApi project routes."
    },
    {
      "name": "projectCopy",
      "description": "Project copy naming routes."
    },
    {
      "name": "pty",
      "description": "Experimental HttpApi PTY routes."
    },
    {
      "name": "question",
      "description": "Question routes."
    },
    {
      "name": "permission",
      "description": "Experimental HttpApi permission routes."
    },
    {
      "name": "provider",
      "description": "Experimental HttpApi provider routes."
    },
    {
      "name": "session",
      "description": "Experimental HttpApi session routes."
    },
    {
      "name": "sync",
      "description": "Experimental HttpApi sync routes."
    },
    {
      "name": "tui",
      "description": "Experimental HttpApi TUI routes."
    },
    {
      "name": "workspace",
      "description": "Experimental HttpApi workspace routes."
    },
    {
      "name": "opencode HttpApi",
      "description": "Experimental HttpApi surface for selected instance routes."
    },
    {
      "name": "opencode HttpApi",
      "description": "Experimental HttpApi surface for selected instance routes."
    },
    {
      "name": "opencode HttpApi",
      "description": "Experimental HttpApi surface for selected instance routes."
    },
    {
      "name": "sessions",
      "description": "Experimental session routes."
    },
    {
      "name": "messages",
      "description": "Experimental message routes."
    },
    {
      "name": "models",
      "description": "Experimental model routes."
    },
    {
      "name": "providers",
      "description": "Experimental provider routes."
    },
    {
      "name": "integrations",
      "description": "Integration discovery and authentication routes."
    },
    {
      "name": "opencode HttpApi",
      "description": "Experimental HttpApi surface for selected instance routes."
    },
    {
      "name": "permissions",
      "description": "Experimental permission routes."
    },
    {
      "name": "filesystem",
      "description": "Experimental location-scoped filesystem routes."
    },
    {
      "name": "commands",
      "description": "Experimental command routes."
    },
    {
      "name": "skills",
      "description": "Experimental skill routes."
    },
    {
      "name": "events",
      "description": "Experimental event stream route."
    },
    {
      "name": "pty",
      "description": "Experimental location-scoped PTY routes."
    },
    {
      "name": "session questions",
      "description": "Experimental session question routes."
    },
    {
      "name": "reference",
      "description": "Location-scoped project references."
    },
    {
      "name": "projectCopy",
      "description": "Project copy management routes."
    },
    {
      "name": "pty",
      "description": "PTY websocket route."
    }
  ]
}
