GitHub Raw JSON API

XiaomiMiMo / MiMo-Code

12,626 TypeScript

MiMo Code: Where Models and Agents Co-Evolve

opencode Specification

Located in packages/sdk/openapi.json on branch HEAD

3.1.1 JSON 105 Endpoints 430.4 KB

Operations & Route Endpoints (100)

GET /global/health
Get health
GET /global/event
Get global events
GET /global/config
Get global configuration
PATCH /global/config
Update global configuration
POST /global/dispose
Dispose instance
POST /global/upgrade
Upgrade opencode
PUT /auth/{providerID}
Set auth credentials
DELETE /auth/{providerID}
Remove auth credentials
POST /log
Write log
GET /experimental/workspace/adaptor
List workspace adaptors
POST /experimental/workspace
Create workspace
GET /experimental/workspace
List workspaces
GET /experimental/workspace/status
Workspace status
DELETE /experimental/workspace/{id}
Remove workspace
POST /experimental/workspace/{id}/session-restore
Restore session into workspace
GET /project
List all projects
GET /project/current
Get current project
POST /project/git/init
Initialize git repository
PATCH /project/{projectID}
Update project
GET /pty
List PTY sessions
POST /pty
Create PTY session
GET /pty/{ptyID}
Get PTY session
PUT /pty/{ptyID}
Update PTY session
DELETE /pty/{ptyID}
Remove PTY session
GET /pty/{ptyID}/connect
Connect to PTY session
GET /config
Get configuration
PATCH /config
Update configuration
GET /config/providers
List config providers
GET /experimental/console
Get active Console provider metadata
GET /experimental/console/orgs
List switchable Console orgs
POST /experimental/console/switch
Switch active Console org
GET /experimental/tool/ids
List tool IDs
GET /experimental/tool
List tools
POST /experimental/worktree
Create worktree
GET /experimental/worktree
List worktrees
DELETE /experimental/worktree
Remove worktree
POST /experimental/worktree/reset
Reset worktree
GET /experimental/session
List sessions
GET /experimental/resource
Get MCP resources
GET /session
List sessions
POST /session
Create session
GET /session/status
Get session status
GET /session/{sessionID}
Get session
DELETE /session/{sessionID}
Delete session
PATCH /session/{sessionID}
Update session
GET /session/{sessionID}/children
Get session children
GET /session/{sessionID}/todo
Get session todos
GET /session/{sessionID}/task
List session tasks
POST /session/{sessionID}/init
Initialize session
POST /session/{sessionID}/fork
Fork session
POST /session/{sessionID}/abort
Abort session
POST /session/{sessionID}/share
Share session
DELETE /session/{sessionID}/share
Unshare session
GET /session/{sessionID}/diff
Get message diff
POST /session/{sessionID}/summarize
Summarize session
GET /session/{sessionID}/message
Get session messages
POST /session/{sessionID}/message
Send message
GET /session/{sessionID}/message/{messageID}
Get message
DELETE /session/{sessionID}/message/{messageID}
Delete message
DELETE /session/{sessionID}/message/{messageID}/part/{partID}
part.delete
PATCH /session/{sessionID}/message/{messageID}/part/{partID}
part.update
POST /session/{sessionID}/prompt_async
Send async message
POST /session/{sessionID}/command
Send command
POST /session/{sessionID}/predict
Predict next prompt
POST /session/{sessionID}/shell
Run shell command
POST /session/{sessionID}/revert
Revert message
POST /session/{sessionID}/unrevert
Restore reverted messages
POST /session/{sessionID}/permissions/{permissionID}
Respond to permission
GET /session/{sessionID}/actors
List session actors
POST /permission/{requestID}/reply
Respond to permission request
GET /permission
List pending permissions
GET /workflows
List workflow runs
POST /workflows/{runID}/resume
Resume a workflow run
GET /question
List pending questions
GET /question/never-ask
Get never-ask state
POST /question/never-ask
Set never-ask state
POST /question/{requestID}/reply
Reply to question request
POST /question/{requestID}/reject
Reject question request
GET /bash-interactive
List pending interactive bash requests
POST /bash-interactive/{id}/reply
Reply to interactive bash request
GET /provider
List providers
GET /provider/auth
Get provider auth methods
POST /provider/{providerID}/oauth/authorize
OAuth authorize
POST /provider/{providerID}/oauth/callback
OAuth callback
POST /sync/start
Start workspace sync
POST /sync/replay
Replay sync events
POST /sync/history
List sync events
GET /find
Find text
GET /find/file
Find files
GET /find/symbol
Find symbols
GET /file
List files
GET /file/content
Read file
GET /file/status
Get file status
GET /event
Subscribe to events
GET /mcp
Get MCP status
POST /mcp
Add MCP server
POST /mcp/{name}/auth
Start MCP OAuth
DELETE /mcp/{name}/auth
Remove MCP OAuth
POST /mcp/{name}/auth/callback
Complete MCP OAuth
POST /mcp/{name}/auth/authenticate
Authenticate MCP OAuth
Raw JSON Specification
{
  "openapi": "3.1.1",
  "info": {
    "title": "opencode",
    "description": "opencode api",
    "version": "1.0.0"
  },
  "paths": {
    "/global/health": {
      "get": {
        "operationId": "global.health",
        "summary": "Get health",
        "description": "Get health information about the OpenCode server.",
        "responses": {
          "200": {
            "description": "Health information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "healthy": {
                      "type": "boolean",
                      "const": true
                    },
                    "version": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "healthy",
                    "version"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.health({\n  ...\n})"
          }
        ]
      }
    },
    "/global/event": {
      "get": {
        "operationId": "global.event",
        "summary": "Get global events",
        "description": "Subscribe to global events from the OpenCode system using server-sent events.",
        "responses": {
          "200": {
            "description": "Event stream",
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/GlobalEvent"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.event({\n  ...\n})"
          }
        ]
      }
    },
    "/global/config": {
      "get": {
        "operationId": "global.config.get",
        "summary": "Get global configuration",
        "description": "Retrieve the current global OpenCode configuration settings and preferences.",
        "responses": {
          "200": {
            "description": "Get global config info",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Config"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.get({\n  ...\n})"
          }
        ]
      },
      "patch": {
        "operationId": "global.config.update",
        "summary": "Update global configuration",
        "description": "Update global OpenCode configuration settings and preferences.",
        "responses": {
          "200": {
            "description": "Successfully updated global config",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Config"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Config"
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.update({\n  ...\n})"
          }
        ]
      }
    },
    "/global/dispose": {
      "post": {
        "operationId": "global.dispose",
        "summary": "Dispose instance",
        "description": "Clean up and dispose all OpenCode instances, releasing all resources.",
        "responses": {
          "200": {
            "description": "Global disposed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.dispose({\n  ...\n})"
          }
        ]
      }
    },
    "/global/upgrade": {
      "post": {
        "operationId": "global.upgrade",
        "summary": "Upgrade opencode",
        "description": "Upgrade opencode to the specified version or latest if not specified.",
        "responses": {
          "200": {
            "description": "Upgrade result",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "type": "boolean",
                          "const": true
                        },
                        "version": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "version"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "type": "boolean",
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "target": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.upgrade({\n  ...\n})"
          }
        ]
      }
    },
    "/auth/{providerID}": {
      "put": {
        "operationId": "auth.set",
        "summary": "Set auth credentials",
        "description": "Set authentication credentials",
        "responses": {
          "200": {
            "description": "Successfully set authentication credentials",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "providerID",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Auth"
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.set({\n  ...\n})"
          }
        ]
      },
      "delete": {
        "operationId": "auth.remove",
        "summary": "Remove auth credentials",
        "description": "Remove authentication credentials",
        "responses": {
          "200": {
            "description": "Successfully removed authentication credentials",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "providerID",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.remove({\n  ...\n})"
          }
        ]
      }
    },
    "/log": {
      "post": {
        "operationId": "app.log",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Write log",
        "description": "Write a log entry to the server logs with specified level and metadata.",
        "responses": {
          "200": {
            "description": "Log entry written successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "service": {
                    "description": "Service name for the log entry",
                    "type": "string"
                  },
                  "level": {
                    "description": "Log level",
                    "type": "string",
                    "enum": [
                      "debug",
                      "info",
                      "error",
                      "warn"
                    ]
                  },
                  "message": {
                    "description": "Log message",
                    "type": "string"
                  },
                  "extra": {
                    "description": "Additional metadata for the log entry",
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  }
                },
                "required": [
                  "service",
                  "level",
                  "message"
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.log({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/workspace/adaptor": {
      "get": {
        "operationId": "experimental.workspace.adaptor.list",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "List workspace adaptors",
        "description": "List all available workspace adaptors for the current project.",
        "responses": {
          "200": {
            "description": "Workspace adaptors",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "name",
                      "description"
                    ]
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.adaptor.list({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/workspace": {
      "post": {
        "operationId": "experimental.workspace.create",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Create workspace",
        "description": "Create a workspace for the current project.",
        "responses": {
          "200": {
            "description": "Workspace created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workspace"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "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",
                  "branch",
                  "extra"
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.create({\n  ...\n})"
          }
        ]
      },
      "get": {
        "operationId": "experimental.workspace.list",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "List workspaces",
        "description": "List all workspaces.",
        "responses": {
          "200": {
            "description": "Workspaces",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Workspace"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.list({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/workspace/status": {
      "get": {
        "operationId": "experimental.workspace.status",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Workspace status",
        "description": "Get connection status for workspaces in the current project.",
        "responses": {
          "200": {
            "description": "Workspace status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "workspaceID": {
                        "type": "string",
                        "pattern": "^wrk.*"
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "connected",
                          "connecting",
                          "disconnected",
                          "error"
                        ]
                      }
                    },
                    "required": [
                      "workspaceID",
                      "status"
                    ]
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.status({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/workspace/{id}": {
      "delete": {
        "operationId": "experimental.workspace.remove",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "pattern": "^wrk.*"
            },
            "required": true
          }
        ],
        "summary": "Remove workspace",
        "description": "Remove an existing workspace.",
        "responses": {
          "200": {
            "description": "Workspace removed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workspace"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.remove({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/workspace/{id}/session-restore": {
      "post": {
        "operationId": "experimental.workspace.sessionRestore",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "pattern": "^wrk.*"
            },
            "required": true
          }
        ],
        "summary": "Restore session into workspace",
        "description": "Replay a session's sync events into the target workspace in batches.",
        "responses": {
          "200": {
            "description": "Session replay started",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "total"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sessionID": {
                    "type": "string",
                    "pattern": "^ses.*"
                  }
                },
                "required": [
                  "sessionID"
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.sessionRestore({\n  ...\n})"
          }
        ]
      }
    },
    "/project": {
      "get": {
        "operationId": "project.list",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "List all projects",
        "description": "Get a list of projects that have been opened with OpenCode.",
        "responses": {
          "200": {
            "description": "List of projects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Project"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.list({\n  ...\n})"
          }
        ]
      }
    },
    "/project/current": {
      "get": {
        "operationId": "project.current",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Get current project",
        "description": "Retrieve the currently active project that OpenCode is working with.",
        "responses": {
          "200": {
            "description": "Current project information",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.current({\n  ...\n})"
          }
        ]
      }
    },
    "/project/git/init": {
      "post": {
        "operationId": "project.initGit",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Initialize git repository",
        "description": "Create a git repository for the current project and return the refreshed project info.",
        "responses": {
          "200": {
            "description": "Project information after git initialization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.initGit({\n  ...\n})"
          }
        ]
      }
    },
    "/project/{projectID}": {
      "patch": {
        "operationId": "project.update",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "projectID",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "summary": "Update project",
        "description": "Update project properties such as name, icon, and commands.",
        "responses": {
          "200": {
            "description": "Updated project information",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "icon": {
                    "type": "object",
                    "properties": {
                      "url": {
                        "type": "string"
                      },
                      "override": {
                        "type": "string"
                      },
                      "color": {
                        "type": "string"
                      }
                    }
                  },
                  "commands": {
                    "type": "object",
                    "properties": {
                      "start": {
                        "description": "Startup script to run when creating a new workspace (worktree)",
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.update({\n  ...\n})"
          }
        ]
      }
    },
    "/pty": {
      "get": {
        "operationId": "pty.list",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "List PTY sessions",
        "description": "Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.",
        "responses": {
          "200": {
            "description": "List of sessions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Pty"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.list({\n  ...\n})"
          }
        ]
      },
      "post": {
        "operationId": "pty.create",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Create PTY session",
        "description": "Create a new pseudo-terminal (PTY) session for running shell commands and processes.",
        "responses": {
          "200": {
            "description": "Created session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pty"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "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",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.create({\n  ...\n})"
          }
        ]
      }
    },
    "/pty/{ptyID}": {
      "get": {
        "operationId": "pty.get",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "ptyID",
            "schema": {
              "type": "string",
              "pattern": "^pty.*"
            },
            "required": true
          }
        ],
        "summary": "Get PTY session",
        "description": "Retrieve detailed information about a specific pseudo-terminal (PTY) session.",
        "responses": {
          "200": {
            "description": "Session info",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pty"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.get({\n  ...\n})"
          }
        ]
      },
      "put": {
        "operationId": "pty.update",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "ptyID",
            "schema": {
              "type": "string",
              "pattern": "^pty.*"
            },
            "required": true
          }
        ],
        "summary": "Update PTY session",
        "description": "Update properties of an existing pseudo-terminal (PTY) session.",
        "responses": {
          "200": {
            "description": "Updated session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pty"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string"
                  },
                  "size": {
                    "type": "object",
                    "properties": {
                      "rows": {
                        "type": "number"
                      },
                      "cols": {
                        "type": "number"
                      }
                    },
                    "required": [
                      "rows",
                      "cols"
                    ]
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.update({\n  ...\n})"
          }
        ]
      },
      "delete": {
        "operationId": "pty.remove",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "ptyID",
            "schema": {
              "type": "string",
              "pattern": "^pty.*"
            },
            "required": true
          }
        ],
        "summary": "Remove PTY session",
        "description": "Remove and terminate a specific pseudo-terminal (PTY) session.",
        "responses": {
          "200": {
            "description": "Session removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.remove({\n  ...\n})"
          }
        ]
      }
    },
    "/pty/{ptyID}/connect": {
      "get": {
        "operationId": "pty.connect",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "ptyID",
            "schema": {
              "type": "string",
              "pattern": "^pty.*"
            },
            "required": true
          }
        ],
        "summary": "Connect to PTY session",
        "description": "Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.",
        "responses": {
          "200": {
            "description": "Connected session",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connect({\n  ...\n})"
          }
        ]
      }
    },
    "/config": {
      "get": {
        "operationId": "config.get",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Get configuration",
        "description": "Retrieve the current OpenCode configuration settings and preferences.",
        "responses": {
          "200": {
            "description": "Get config info",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Config"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.get({\n  ...\n})"
          }
        ]
      },
      "patch": {
        "operationId": "config.update",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Update configuration",
        "description": "Update OpenCode configuration settings and preferences.",
        "responses": {
          "200": {
            "description": "Successfully updated config",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Config"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Config"
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.update({\n  ...\n})"
          }
        ]
      }
    },
    "/config/providers": {
      "get": {
        "operationId": "config.providers",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "List config providers",
        "description": "Get a list of all configured AI providers and their default models.",
        "responses": {
          "200": {
            "description": "List of providers",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "providers": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Provider"
                      }
                    },
                    "default": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "providers",
                    "default"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.providers({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/console": {
      "get": {
        "operationId": "experimental.console.get",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Get active Console provider metadata",
        "description": "Get the active Console org name and the set of provider IDs managed by that Console org.",
        "responses": {
          "200": {
            "description": "Active Console provider metadata",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsoleState"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.get({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/console/orgs": {
      "get": {
        "operationId": "experimental.console.listOrgs",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "List switchable Console orgs",
        "description": "Get the available Console orgs across logged-in accounts, including the current active org.",
        "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"
                        ]
                      }
                    }
                  },
                  "required": [
                    "orgs"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.listOrgs({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/console/switch": {
      "post": {
        "operationId": "experimental.console.switchOrg",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Switch active Console org",
        "description": "Persist a new active Console account/org selection for the current local OpenCode state.",
        "responses": {
          "200": {
            "description": "Switch success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "accountID": {
                    "type": "string"
                  },
                  "orgID": {
                    "type": "string"
                  }
                },
                "required": [
                  "accountID",
                  "orgID"
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.switchOrg({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/tool/ids": {
      "get": {
        "operationId": "tool.ids",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "List tool IDs",
        "description": "Get a list of all available tool IDs, including both built-in tools and dynamically registered tools.",
        "responses": {
          "200": {
            "description": "Tool IDs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolIDs"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.ids({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/tool": {
      "get": {
        "operationId": "tool.list",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "provider",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "model",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "summary": "List tools",
        "description": "Get a list of available tools with their JSON schema parameters for a specific provider and model combination.",
        "responses": {
          "200": {
            "description": "Tools",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolList"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.list({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/worktree": {
      "post": {
        "operationId": "worktree.create",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Create worktree",
        "description": "Create a new git worktree for the current project and run any configured startup scripts.",
        "responses": {
          "200": {
            "description": "Worktree created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Worktree"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorktreeCreateInput"
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.create({\n  ...\n})"
          }
        ]
      },
      "get": {
        "operationId": "worktree.list",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "List worktrees",
        "description": "List all sandbox worktrees for the current project.",
        "responses": {
          "200": {
            "description": "List of worktree directories",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.list({\n  ...\n})"
          }
        ]
      },
      "delete": {
        "operationId": "worktree.remove",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Remove worktree",
        "description": "Remove a git worktree and delete its branch.",
        "responses": {
          "200": {
            "description": "Worktree removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorktreeRemoveInput"
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.remove({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/worktree/reset": {
      "post": {
        "operationId": "worktree.reset",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Reset worktree",
        "description": "Reset a worktree branch to the primary default branch.",
        "responses": {
          "200": {
            "description": "Worktree reset",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorktreeResetInput"
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.reset({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/session": {
      "get": {
        "operationId": "experimental.session.list",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            },
            "description": "Filter sessions by project directory"
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "roots",
            "schema": {
              "type": "boolean"
            },
            "description": "Only return root sessions (no parentID)"
          },
          {
            "in": "query",
            "name": "start",
            "schema": {
              "type": "number"
            },
            "description": "Filter sessions updated on or after this timestamp (milliseconds since epoch)"
          },
          {
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "number"
            },
            "description": "Return sessions updated before this timestamp (milliseconds since epoch)"
          },
          {
            "in": "query",
            "name": "search",
            "schema": {
              "type": "string"
            },
            "description": "Filter sessions by title (case-insensitive)"
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "number"
            },
            "description": "Maximum number of sessions to return"
          },
          {
            "in": "query",
            "name": "archived",
            "schema": {
              "type": "boolean"
            },
            "description": "Include archived sessions (default false)"
          }
        ],
        "summary": "List sessions",
        "description": "Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.",
        "responses": {
          "200": {
            "description": "List of sessions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GlobalSession"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.session.list({\n  ...\n})"
          }
        ]
      }
    },
    "/experimental/resource": {
      "get": {
        "operationId": "experimental.resource.list",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Get MCP resources",
        "description": "Get all available MCP resources from connected servers. Optionally filter by name.",
        "responses": {
          "200": {
            "description": "MCP resources",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {
                    "$ref": "#/components/schemas/McpResource"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.resource.list({\n  ...\n})"
          }
        ]
      }
    },
    "/session": {
      "get": {
        "operationId": "session.list",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            },
            "description": "Filter sessions by project directory"
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "roots",
            "schema": {
              "type": "boolean"
            },
            "description": "Only return root sessions (no parentID)"
          },
          {
            "in": "query",
            "name": "start",
            "schema": {
              "type": "number"
            },
            "description": "Filter sessions updated on or after this timestamp (milliseconds since epoch)"
          },
          {
            "in": "query",
            "name": "search",
            "schema": {
              "type": "string"
            },
            "description": "Filter sessions by title (case-insensitive)"
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "number"
            },
            "description": "Maximum number of sessions to return"
          }
        ],
        "summary": "List sessions",
        "description": "Get a list of all OpenCode sessions, sorted by most recently updated.",
        "responses": {
          "200": {
            "description": "List of sessions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Session"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.list({\n  ...\n})"
          }
        ]
      },
      "post": {
        "operationId": "session.create",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Create session",
        "description": "Create a new OpenCode session for interacting with AI assistants and managing conversations.",
        "responses": {
          "200": {
            "description": "Successfully created session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "parentID": {
                    "type": "string",
                    "pattern": "^ses.*"
                  },
                  "contextFrom": {
                    "type": "string",
                    "pattern": "^ses.*"
                  },
                  "contextWatermark": {
                    "type": "string",
                    "pattern": "^msg.*"
                  },
                  "title": {
                    "type": "string"
                  },
                  "permission": {
                    "$ref": "#/components/schemas/PermissionRuleset"
                  },
                  "workspaceID": {
                    "type": "string",
                    "pattern": "^wrk.*"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.create({\n  ...\n})"
          }
        ]
      }
    },
    "/session/status": {
      "get": {
        "operationId": "session.status",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Get session status",
        "description": "Retrieve the current status of all sessions, including active, idle, and completed states.",
        "responses": {
          "200": {
            "description": "Get session status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {
                    "$ref": "#/components/schemas/SessionStatus"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.status({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}": {
      "get": {
        "operationId": "session.get",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sessionID",
            "schema": {
              "type": "string",
              "pattern": "^ses.*"
            },
            "required": true
          }
        ],
        "summary": "Get session",
        "description": "Retrieve detailed information about a specific OpenCode session.",
        "tags": [
          "Session"
        ],
        "responses": {
          "200": {
            "description": "Get session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.get({\n  ...\n})"
          }
        ]
      },
      "delete": {
        "operationId": "session.delete",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sessionID",
            "schema": {
              "type": "string",
              "pattern": "^ses.*"
            },
            "required": true
          }
        ],
        "summary": "Delete session",
        "description": "Delete a session and permanently remove all associated data, including messages and history.",
        "responses": {
          "200": {
            "description": "Successfully deleted session",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.delete({\n  ...\n})"
          }
        ]
      },
      "patch": {
        "operationId": "session.update",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sessionID",
            "schema": {
              "type": "string",
              "pattern": "^ses.*"
            },
            "required": true
          }
        ],
        "summary": "Update session",
        "description": "Update properties of an existing session, such as title or other metadata.",
        "responses": {
          "200": {
            "description": "Successfully updated session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string"
                  },
                  "permission": {
                    "$ref": "#/components/schemas/PermissionRuleset"
                  },
                  "time": {
                    "type": "object",
                    "properties": {
                      "archived": {
                        "type": "number"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.update({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/children": {
      "get": {
        "operationId": "session.children",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sessionID",
            "schema": {
              "type": "string",
              "pattern": "^ses.*"
            },
            "required": true
          }
        ],
        "summary": "Get session children",
        "tags": [
          "Session"
        ],
        "description": "Retrieve all child sessions that were forked from the specified parent session.",
        "responses": {
          "200": {
            "description": "List of children",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Session"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.children({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/todo": {
      "get": {
        "operationId": "session.todo",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sessionID",
            "schema": {
              "type": "string",
              "pattern": "^ses.*"
            },
            "required": true
          }
        ],
        "summary": "Get session todos",
        "description": "Retrieve the todo list associated with a specific session, showing tasks and action items.",
        "responses": {
          "200": {
            "description": "Todo list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Todo"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.todo({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/task": {
      "get": {
        "operationId": "session.task",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sessionID",
            "schema": {
              "type": "string",
              "pattern": "^ses.*"
            },
            "required": true
          }
        ],
        "summary": "List session tasks",
        "description": "List tasks registered for a session (the work-item registry).",
        "responses": {
          "200": {
            "description": "Task list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "^T\\d+(\\.\\d+)*$"
                      },
                      "session_id": {
                        "type": "string",
                        "pattern": "^ses.*"
                      },
                      "parent_task_id": {
                        "type": "string",
                        "pattern": "^T\\d+(\\.\\d+)*$"
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "open",
                          "in_progress",
                          "blocked",
                          "done",
                          "abandoned"
                        ]
                      },
                      "summary": {
                        "type": "string"
                      },
                      "owner": {
                        "type": "string"
                      },
                      "created_at": {
                        "type": "number"
                      },
                      "last_event_at": {
                        "type": "number"
                      },
                      "ended_at": {
                        "type": "number"
                      },
                      "cleanup_after": {
                        "type": "number"
                      }
                    },
                    "required": [
                      "id",
                      "session_id",
                      "status",
                      "summary",
                      "created_at",
                      "last_event_at"
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.task({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/init": {
      "post": {
        "operationId": "session.init",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sessionID",
            "schema": {
              "type": "string",
              "pattern": "^ses.*"
            },
            "required": true
          }
        ],
        "summary": "Initialize session",
        "description": "Analyze the current application and create an AGENTS.md file with project-specific agent configurations.",
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "modelID": {
                    "type": "string"
                  },
                  "providerID": {
                    "type": "string"
                  },
                  "messageID": {
                    "type": "string",
                    "pattern": "^msg.*"
                  }
                },
                "required": [
                  "modelID",
                  "providerID",
                  "messageID"
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.init({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/fork": {
      "post": {
        "operationId": "session.fork",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sessionID",
            "schema": {
              "type": "string",
              "pattern": "^ses.*"
            },
            "required": true
          }
        ],
        "summary": "Fork session",
        "description": "Create a new session by forking an existing session at a specific message point.",
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "messageID": {
                    "type": "string",
                    "pattern": "^msg.*"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.fork({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/abort": {
      "post": {
        "operationId": "session.abort",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sessionID",
            "schema": {
              "type": "string",
              "pattern": "^ses.*"
            },
            "required": true
          }
        ],
        "summary": "Abort session",
        "description": "Abort an active session and stop any ongoing AI processing or command execution.",
        "responses": {
          "200": {
            "description": "Aborted session",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.abort({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/share": {
      "post": {
        "operationId": "session.share",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sessionID",
            "schema": {
              "type": "string",
              "pattern": "^ses.*"
            },
            "required": true
          }
        ],
        "summary": "Share session",
        "description": "Create a shareable link for a session, allowing others to view the conversation.",
        "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": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.share({\n  ...\n})"
          }
        ]
      },
      "delete": {
        "operationId": "session.unshare",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sessionID",
            "schema": {
              "type": "string",
              "pattern": "^ses.*"
            },
            "required": true
          }
        ],
        "summary": "Unshare session",
        "description": "Remove the shareable link for a session, making it private again.",
        "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": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unshare({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/diff": {
      "get": {
        "operationId": "session.diff",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sessionID",
            "schema": {
              "type": "string",
              "pattern": "^ses.*"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "messageID",
            "schema": {
              "type": "string",
              "pattern": "^msg.*"
            }
          }
        ],
        "summary": "Get message diff",
        "description": "Get the file changes (diff) that resulted from a specific user message in the session.",
        "responses": {
          "200": {
            "description": "Successfully retrieved diff",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SnapshotFileDiff"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.diff({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/summarize": {
      "post": {
        "operationId": "session.summarize",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sessionID",
            "schema": {
              "type": "string",
              "pattern": "^ses.*"
            },
            "required": true
          }
        ],
        "summary": "Summarize session",
        "description": "Generate a concise summary of the session using AI compaction to preserve key information.",
        "responses": {
          "200": {
            "description": "Summarized session",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "providerID": {
                    "type": "string"
                  },
                  "modelID": {
                    "type": "string"
                  },
                  "auto": {
                    "default": false,
                    "type": "boolean"
                  }
                },
                "required": [
                  "providerID",
                  "modelID"
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.summarize({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/message": {
      "get": {
        "operationId": "session.messages",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sessionID",
            "schema": {
              "type": "string",
              "pattern": "^ses.*"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "description": "Maximum number of messages to return"
          },
          {
            "in": "query",
            "name": "before",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "agent_id",
            "schema": {
              "type": "string"
            },
            "description": "Filter by message slice. Omitted = main-agent slice only (default). Pass a subagent's actor id to fetch its slice. Pass `*` to return every message regardless of slice."
          }
        ],
        "summary": "Get session messages",
        "description": "Retrieve all messages in a session, including user prompts and AI responses.",
        "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"
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.messages({\n  ...\n})"
          }
        ]
      },
      "post": {
        "operationId": "session.prompt",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sessionID",
            "schema": {
              "type": "string",
              "pattern": "^ses.*"
            },
            "required": true
          }
        ],
        "summary": "Send message",
        "description": "Create and send a new message to a session, streaming the AI response.",
        "responses": {
          "200": {
            "description": "Created message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "info": {
                      "$ref": "#/components/schemas/AssistantMessage"
                    },
                    "parts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Part"
                      }
                    }
                  },
                  "required": [
                    "info",
                    "parts"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict — session resource is busy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          }
        },
        "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"
                    ]
                  },
                  "modelRef": {
                    "description": "Model group/tier name (e.g. ultra/standard/lite) or a literal provider/model. Resolved provider-aware. Takes precedence over `model` when both are set.",
                    "type": "string"
                  },
                  "agent": {
                    "type": "string"
                  },
                  "agentID": {
                    "type": "string"
                  },
                  "task_id": {
                    "description": "If the spawning caller bound this prompt to a specific user-task (T4 etc), pass its TID. Propagates to Tool.Context.taskId so memory-path-guard allows writes to tasks/<task_id>/*.md.",
                    "type": "string"
                  },
                  "source": {
                    "type": "string",
                    "enum": [
                      "user",
                      "spawn",
                      "hook"
                    ]
                  },
                  "provenance": {
                    "$ref": "#/components/schemas/Provenance"
                  },
                  "noReply": {
                    "type": "boolean"
                  },
                  "tools": {
                    "description": "@deprecated tools and permissions have been merged, you can set permissions on the session itself now",
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "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"
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/message/{messageID}": {
      "get": {
        "operationId": "session.message",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sessionID",
            "schema": {
              "type": "string",
              "pattern": "^ses.*"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "messageID",
            "schema": {
              "type": "string",
              "pattern": "^msg.*"
            },
            "required": true
          }
        ],
        "summary": "Get message",
        "description": "Retrieve a specific message from a session by its message ID.",
        "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"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.message({\n  ...\n})"
          }
        ]
      },
      "delete": {
        "operationId": "session.deleteMessage",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sessionID",
            "schema": {
              "type": "string",
              "pattern": "^ses.*"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "messageID",
            "schema": {
              "type": "string",
              "pattern": "^msg.*"
            },
            "required": true
          }
        ],
        "summary": "Delete message",
        "description": "Permanently delete a specific message (and all of its parts) from a session. This does not revert any file changes that may have been made while processing the message.",
        "responses": {
          "200": {
            "description": "Successfully deleted message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.deleteMessage({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/message/{messageID}/part/{partID}": {
      "delete": {
        "operationId": "part.delete",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sessionID",
            "schema": {
              "type": "string",
              "pattern": "^ses.*"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "messageID",
            "schema": {
              "type": "string",
              "pattern": "^msg.*"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "partID",
            "schema": {
              "type": "string",
              "pattern": "^prt.*"
            },
            "required": true
          }
        ],
        "description": "Delete a part from a message",
        "responses": {
          "200": {
            "description": "Successfully deleted part",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.delete({\n  ...\n})"
          }
        ]
      },
      "patch": {
        "operationId": "part.update",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sessionID",
            "schema": {
              "type": "string",
              "pattern": "^ses.*"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "messageID",
            "schema": {
              "type": "string",
              "pattern": "^msg.*"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "partID",
            "schema": {
              "type": "string",
              "pattern": "^prt.*"
            },
            "required": true
          }
        ],
        "description": "Update a part in a message",
        "responses": {
          "200": {
            "description": "Successfully updated part",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Part"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Part"
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.update({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/prompt_async": {
      "post": {
        "operationId": "session.prompt_async",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sessionID",
            "schema": {
              "type": "string",
              "pattern": "^ses.*"
            },
            "required": true
          }
        ],
        "summary": "Send async message",
        "description": "Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.",
        "responses": {
          "204": {
            "description": "Prompt accepted"
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "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"
                    ]
                  },
                  "modelRef": {
                    "description": "Model group/tier name (e.g. ultra/standard/lite) or a literal provider/model. Resolved provider-aware. Takes precedence over `model` when both are set.",
                    "type": "string"
                  },
                  "agent": {
                    "type": "string"
                  },
                  "agentID": {
                    "type": "string"
                  },
                  "task_id": {
                    "description": "If the spawning caller bound this prompt to a specific user-task (T4 etc), pass its TID. Propagates to Tool.Context.taskId so memory-path-guard allows writes to tasks/<task_id>/*.md.",
                    "type": "string"
                  },
                  "source": {
                    "type": "string",
                    "enum": [
                      "user",
                      "spawn",
                      "hook"
                    ]
                  },
                  "provenance": {
                    "$ref": "#/components/schemas/Provenance"
                  },
                  "noReply": {
                    "type": "boolean"
                  },
                  "tools": {
                    "description": "@deprecated tools and permissions have been merged, you can set permissions on the session itself now",
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "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"
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt_async({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/command": {
      "post": {
        "operationId": "session.command",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sessionID",
            "schema": {
              "type": "string",
              "pattern": "^ses.*"
            },
            "required": true
          }
        ],
        "summary": "Send command",
        "description": "Send a new command to a session for execution by the AI assistant.",
        "responses": {
          "200": {
            "description": "Created message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "info": {
                      "$ref": "#/components/schemas/AssistantMessage"
                    },
                    "parts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Part"
                      }
                    }
                  },
                  "required": [
                    "info",
                    "parts"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "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": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^prt.*"
                            },
                            "type": {
                              "type": "string",
                              "const": "file"
                            },
                            "mime": {
                              "type": "string"
                            },
                            "filename": {
                              "type": "string"
                            },
                            "url": {
                              "type": "string"
                            },
                            "source": {
                              "$ref": "#/components/schemas/FilePartSource"
                            }
                          },
                          "required": [
                            "type",
                            "mime",
                            "url"
                          ]
                        }
                      ]
                    }
                  }
                },
                "required": [
                  "arguments",
                  "command"
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.command({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/predict": {
      "post": {
        "operationId": "session.predict",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sessionID",
            "schema": {
              "type": "string",
              "pattern": "^ses.*"
            },
            "required": true
          }
        ],
        "summary": "Predict next prompt",
        "description": "Predict the user's most likely next prompt based on the latest user message and the assistant's result. Returns an empty string when disabled or unavailable.",
        "responses": {
          "200": {
            "description": "Predicted next prompt",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "prediction": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "prediction"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.predict({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/shell": {
      "post": {
        "operationId": "session.shell",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sessionID",
            "schema": {
              "type": "string",
              "pattern": "^ses.*"
            },
            "required": true
          }
        ],
        "summary": "Run shell command",
        "description": "Execute a shell command within the session context and return the AI's response.",
        "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"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "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"
                    ]
                  },
                  "modelRef": {
                    "description": "Model group/tier name (e.g. ultra/standard/lite) or a literal provider/model. Resolved provider-aware. Takes precedence over `model` when both are set.",
                    "type": "string"
                  },
                  "command": {
                    "type": "string"
                  }
                },
                "required": [
                  "agent",
                  "command"
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.shell({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/revert": {
      "post": {
        "operationId": "session.revert",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sessionID",
            "schema": {
              "type": "string",
              "pattern": "^ses.*"
            },
            "required": true
          }
        ],
        "summary": "Revert message",
        "description": "Revert a specific message in a session, undoing its effects and restoring the previous state.",
        "responses": {
          "200": {
            "description": "Updated session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "messageID": {
                    "type": "string",
                    "pattern": "^msg.*"
                  },
                  "partID": {
                    "type": "string",
                    "pattern": "^prt.*"
                  }
                },
                "required": [
                  "messageID"
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.revert({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/unrevert": {
      "post": {
        "operationId": "session.unrevert",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sessionID",
            "schema": {
              "type": "string",
              "pattern": "^ses.*"
            },
            "required": true
          }
        ],
        "summary": "Restore reverted messages",
        "description": "Restore all previously reverted messages in a session.",
        "responses": {
          "200": {
            "description": "Updated session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unrevert({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/permissions/{permissionID}": {
      "post": {
        "operationId": "permission.respond",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sessionID",
            "schema": {
              "type": "string",
              "pattern": "^ses.*"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "permissionID",
            "schema": {
              "type": "string",
              "pattern": "^per.*"
            },
            "required": true
          }
        ],
        "summary": "Respond to permission",
        "deprecated": true,
        "description": "Approve or deny a permission request from the AI assistant.",
        "responses": {
          "200": {
            "description": "Permission processed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "response": {
                    "type": "string",
                    "enum": [
                      "once",
                      "always",
                      "reject"
                    ]
                  }
                },
                "required": [
                  "response"
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.respond({\n  ...\n})"
          }
        ]
      }
    },
    "/session/{sessionID}/actors": {
      "get": {
        "operationId": "session.actors",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sessionID",
            "schema": {
              "type": "string",
              "pattern": "^ses.*"
            },
            "required": true
          }
        ],
        "summary": "List session actors",
        "description": "List actors registered for a session.",
        "responses": {
          "200": {
            "description": "Actor list"
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.actors({\n  ...\n})"
          }
        ]
      }
    },
    "/permission/{requestID}/reply": {
      "post": {
        "operationId": "permission.reply",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "requestID",
            "schema": {
              "type": "string",
              "pattern": "^per.*"
            },
            "required": true
          }
        ],
        "summary": "Respond to permission request",
        "description": "Approve or deny a permission request from the AI assistant.",
        "responses": {
          "200": {
            "description": "Permission processed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reply": {
                    "type": "string",
                    "enum": [
                      "once",
                      "always",
                      "reject"
                    ]
                  },
                  "message": {
                    "type": "string"
                  }
                },
                "required": [
                  "reply"
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.reply({\n  ...\n})"
          }
        ]
      }
    },
    "/permission": {
      "get": {
        "operationId": "permission.list",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "List pending permissions",
        "description": "Get all pending permission requests across all sessions.",
        "responses": {
          "200": {
            "description": "List of pending permissions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PermissionRequest"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.list({\n  ...\n})"
          }
        ]
      }
    },
    "/workflows": {
      "get": {
        "operationId": "workflow.list",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sessionID",
            "schema": {
              "type": "string",
              "pattern": "^ses.*"
            },
            "required": true
          }
        ],
        "summary": "List workflow runs",
        "description": "List dynamic-workflow runs for a session. sessionID is REQUIRED — there is no per-user identity, so the session is the access boundary and an omitted/invalid sessionID is a 400 (never an unfiltered all-session listing). Empty when the workflow runtime is not running.",
        "responses": {
          "200": {
            "description": "Workflow runs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {}
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.workflow.list({\n  ...\n})"
          }
        ]
      }
    },
    "/workflows/{runID}/resume": {
      "post": {
        "operationId": "workflow.resume",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "runID",
            "schema": {
              "type": "string",
              "pattern": "^wf_[0-9A-Za-z]{26}$"
            },
            "required": true
          }
        ],
        "summary": "Resume a workflow run",
        "description": "Re-launch a persisted workflow run by id. Returns { runID, resumed }; resumed is false if the run is unknown, still running, or has no persisted script.",
        "responses": {
          "200": {
            "description": "Resume result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "runID": {
                      "type": "string"
                    },
                    "resumed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "runID",
                    "resumed"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.workflow.resume({\n  ...\n})"
          }
        ]
      }
    },
    "/question": {
      "get": {
        "operationId": "question.list",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "List pending questions",
        "description": "Get all pending question requests across all sessions.",
        "responses": {
          "200": {
            "description": "List of pending questions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/QuestionRequest"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.list({\n  ...\n})"
          }
        ]
      }
    },
    "/question/never-ask": {
      "get": {
        "operationId": "question.neverAsk",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Get never-ask state",
        "description": "Whether the question tool auto-resolves to a [Never-Ask] directive instead of blocking for a user.",
        "responses": {
          "200": {
            "description": "Current never-ask state",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.neverAsk({\n  ...\n})"
          }
        ]
      },
      "post": {
        "operationId": "question.setNeverAsk",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Set never-ask state",
        "description": "Enable or disable never-ask: the question tool stays visible but returns a [Never-Ask] directive so the model resolves decisions itself.",
        "responses": {
          "200": {
            "description": "Updated never-ask state",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "description": "Whether never-ask is enabled",
                    "type": "boolean"
                  }
                },
                "required": [
                  "enabled"
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.setNeverAsk({\n  ...\n})"
          }
        ]
      }
    },
    "/question/{requestID}/reply": {
      "post": {
        "operationId": "question.reply",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "requestID",
            "schema": {
              "type": "string",
              "pattern": "^que.*"
            },
            "required": true
          }
        ],
        "summary": "Reply to question request",
        "description": "Provide answers to a question request from the AI assistant.",
        "responses": {
          "200": {
            "description": "Question answered successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "answers": {
                    "description": "User answers in order of questions (each answer is an array of selected labels)",
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/QuestionAnswer"
                    }
                  }
                },
                "required": [
                  "answers"
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reply({\n  ...\n})"
          }
        ]
      }
    },
    "/question/{requestID}/reject": {
      "post": {
        "operationId": "question.reject",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "requestID",
            "schema": {
              "type": "string",
              "pattern": "^que.*"
            },
            "required": true
          }
        ],
        "summary": "Reject question request",
        "description": "Reject a question request from the AI assistant.",
        "responses": {
          "200": {
            "description": "Question rejected successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reject({\n  ...\n})"
          }
        ]
      }
    },
    "/bash-interactive": {
      "get": {
        "operationId": "bash.interactive.list",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "List pending interactive bash requests",
        "description": "Get all pending interactive bash requests waiting for user interaction.",
        "responses": {
          "200": {
            "description": "List of pending interactive requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "command": {
                        "type": "string"
                      },
                      "cwd": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "command",
                      "cwd",
                      "description"
                    ]
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.bash.interactive.list({\n  ...\n})"
          }
        ]
      }
    },
    "/bash-interactive/{id}/reply": {
      "post": {
        "operationId": "bash.interactive.reply",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "summary": "Reply to interactive bash request",
        "description": "Provide the result of an interactive bash command execution.",
        "responses": {
          "200": {
            "description": "Reply accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "output": {
                    "description": "Captured output from the interactive command",
                    "type": "string"
                  },
                  "exitCode": {
                    "description": "Exit code of the interactive command",
                    "type": "number"
                  }
                },
                "required": [
                  "output",
                  "exitCode"
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.bash.interactive.reply({\n  ...\n})"
          }
        ]
      }
    },
    "/provider": {
      "get": {
        "operationId": "provider.list",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "List providers",
        "description": "Get a list of all available AI providers, including both available and connected ones.",
        "responses": {
          "200": {
            "description": "List of providers",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "all": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Provider"
                      }
                    },
                    "default": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "type": "string"
                      }
                    },
                    "connected": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "all",
                    "default",
                    "connected"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.list({\n  ...\n})"
          }
        ]
      }
    },
    "/provider/auth": {
      "get": {
        "operationId": "provider.auth",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Get provider auth methods",
        "description": "Retrieve available authentication methods for all AI providers.",
        "responses": {
          "200": {
            "description": "Provider auth methods",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/ProviderAuthMethod"
                    }
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.auth({\n  ...\n})"
          }
        ]
      }
    },
    "/provider/{providerID}/oauth/authorize": {
      "post": {
        "operationId": "provider.oauth.authorize",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "providerID",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Provider ID"
          }
        ],
        "summary": "OAuth authorize",
        "description": "Initiate OAuth authorization for a specific AI provider to get an authorization URL.",
        "responses": {
          "200": {
            "description": "Authorization URL and method",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderAuthAuthorization"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "method": {
                    "description": "Auth method index",
                    "type": "number"
                  },
                  "inputs": {
                    "description": "Prompt inputs",
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "method"
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.authorize({\n  ...\n})"
          }
        ]
      }
    },
    "/provider/{providerID}/oauth/callback": {
      "post": {
        "operationId": "provider.oauth.callback",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "providerID",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Provider ID"
          }
        ],
        "summary": "OAuth callback",
        "description": "Handle the OAuth callback from a provider after user authorization.",
        "responses": {
          "200": {
            "description": "OAuth callback processed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "method": {
                    "description": "Auth method index",
                    "type": "number"
                  },
                  "code": {
                    "description": "OAuth authorization code",
                    "type": "string"
                  }
                },
                "required": [
                  "method"
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.callback({\n  ...\n})"
          }
        ]
      }
    },
    "/sync/start": {
      "post": {
        "operationId": "sync.start",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Start workspace sync",
        "description": "Start sync loops for workspaces in the current project that have active sessions.",
        "responses": {
          "200": {
            "description": "Workspace sync started",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.start({\n  ...\n})"
          }
        ]
      }
    },
    "/sync/replay": {
      "post": {
        "operationId": "sync.replay",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Replay sync events",
        "description": "Validate and replay a complete sync event history.",
        "responses": {
          "200": {
            "description": "Replayed sync events",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sessionID": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "sessionID"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "directory": {
                    "type": "string"
                  },
                  "events": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "aggregateID": {
                          "type": "string"
                        },
                        "seq": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "type": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        }
                      },
                      "required": [
                        "id",
                        "aggregateID",
                        "seq",
                        "type",
                        "data"
                      ]
                    }
                  }
                },
                "required": [
                  "directory",
                  "events"
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.replay({\n  ...\n})"
          }
        ]
      }
    },
    "/sync/history": {
      "post": {
        "operationId": "sync.history.list",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "List sync events",
        "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.",
        "responses": {
          "200": {
            "description": "Sync events",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "aggregate_id": {
                        "type": "string"
                      },
                      "seq": {
                        "type": "number"
                      },
                      "type": {
                        "type": "string"
                      },
                      "data": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {}
                      }
                    },
                    "required": [
                      "id",
                      "aggregate_id",
                      "seq",
                      "type",
                      "data"
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.history.list({\n  ...\n})"
          }
        ]
      }
    },
    "/find": {
      "get": {
        "operationId": "find.text",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pattern",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "summary": "Find text",
        "description": "Search for text patterns across files in the project using ripgrep.",
        "responses": {
          "200": {
            "description": "Matches",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "path": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "text"
                        ]
                      },
                      "lines": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "text"
                        ]
                      },
                      "line_number": {
                        "type": "number"
                      },
                      "absolute_offset": {
                        "type": "number"
                      },
                      "submatches": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "match": {
                              "type": "object",
                              "properties": {
                                "text": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "text"
                              ]
                            },
                            "start": {
                              "type": "number"
                            },
                            "end": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "match",
                            "start",
                            "end"
                          ]
                        }
                      }
                    },
                    "required": [
                      "path",
                      "lines",
                      "line_number",
                      "absolute_offset",
                      "submatches"
                    ]
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.text({\n  ...\n})"
          }
        ]
      }
    },
    "/find/file": {
      "get": {
        "operationId": "find.files",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "query",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "dirs",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "in": "query",
            "name": "type",
            "schema": {
              "type": "string",
              "enum": [
                "file",
                "directory"
              ]
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          }
        ],
        "summary": "Find files",
        "description": "Search for files or directories by name or pattern in the project directory.",
        "responses": {
          "200": {
            "description": "File paths",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.files({\n  ...\n})"
          }
        ]
      }
    },
    "/find/symbol": {
      "get": {
        "operationId": "find.symbols",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "query",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "summary": "Find symbols",
        "description": "Search for workspace symbols like functions, classes, and variables using LSP.",
        "responses": {
          "200": {
            "description": "Symbols",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Symbol"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.symbols({\n  ...\n})"
          }
        ]
      }
    },
    "/file": {
      "get": {
        "operationId": "file.list",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "summary": "List files",
        "description": "List files and directories in a specified path.",
        "responses": {
          "200": {
            "description": "Files and directories",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FileNode"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.list({\n  ...\n})"
          }
        ]
      }
    },
    "/file/content": {
      "get": {
        "operationId": "file.read",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "summary": "Read file",
        "description": "Read the content of a specified file.",
        "responses": {
          "200": {
            "description": "File content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileContent"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.read({\n  ...\n})"
          }
        ]
      }
    },
    "/file/status": {
      "get": {
        "operationId": "file.status",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Get file status",
        "description": "Get the git status of all files in the project.",
        "responses": {
          "200": {
            "description": "File status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/File"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.status({\n  ...\n})"
          }
        ]
      }
    },
    "/event": {
      "get": {
        "operationId": "event.subscribe",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Subscribe to events",
        "description": "Get events",
        "responses": {
          "200": {
            "description": "Event stream",
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/Event"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.event.subscribe({\n  ...\n})"
          }
        ]
      }
    },
    "/mcp": {
      "get": {
        "operationId": "mcp.status",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Get MCP status",
        "description": "Get the status of all Model Context Protocol (MCP) servers.",
        "responses": {
          "200": {
            "description": "MCP server status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {
                    "$ref": "#/components/schemas/MCPStatus"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.status({\n  ...\n})"
          }
        ]
      },
      "post": {
        "operationId": "mcp.add",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Add MCP server",
        "description": "Dynamically add a new Model Context Protocol (MCP) server to the system.",
        "responses": {
          "200": {
            "description": "MCP server added successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {
                    "$ref": "#/components/schemas/MCPStatus"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "config": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/McpLocalConfig"
                      },
                      {
                        "$ref": "#/components/schemas/McpRemoteConfig"
                      }
                    ]
                  }
                },
                "required": [
                  "name",
                  "config"
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.add({\n  ...\n})"
          }
        ]
      }
    },
    "/mcp/{name}/auth": {
      "post": {
        "operationId": "mcp.auth.start",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "name",
            "required": true
          }
        ],
        "summary": "Start MCP OAuth",
        "description": "Start OAuth authentication flow for a Model Context Protocol (MCP) server.",
        "responses": {
          "200": {
            "description": "OAuth flow started",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "authorizationUrl": {
                      "description": "URL to open in browser for authorization",
                      "type": "string"
                    }
                  },
                  "required": [
                    "authorizationUrl"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.start({\n  ...\n})"
          }
        ]
      },
      "delete": {
        "operationId": "mcp.auth.remove",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "name",
            "required": true
          }
        ],
        "summary": "Remove MCP OAuth",
        "description": "Remove OAuth credentials for an MCP server",
        "responses": {
          "200": {
            "description": "OAuth credentials removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.remove({\n  ...\n})"
          }
        ]
      }
    },
    "/mcp/{name}/auth/callback": {
      "post": {
        "operationId": "mcp.auth.callback",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "name",
            "required": true
          }
        ],
        "summary": "Complete MCP OAuth",
        "description": "Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.",
        "responses": {
          "200": {
            "description": "OAuth authentication completed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MCPStatus"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "description": "Authorization code from OAuth callback",
                    "type": "string"
                  }
                },
                "required": [
                  "code"
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.callback({\n  ...\n})"
          }
        ]
      }
    },
    "/mcp/{name}/auth/authenticate": {
      "post": {
        "operationId": "mcp.auth.authenticate",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "name",
            "required": true
          }
        ],
        "summary": "Authenticate MCP OAuth",
        "description": "Start OAuth flow and wait for callback (opens browser)",
        "responses": {
          "200": {
            "description": "OAuth authentication completed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MCPStatus"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.authenticate({\n  ...\n})"
          }
        ]
      }
    },
    "/mcp/{name}/connect": {
      "post": {
        "operationId": "mcp.connect",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "name",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "description": "Connect an MCP server",
        "responses": {
          "200": {
            "description": "MCP server connected successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.connect({\n  ...\n})"
          }
        ]
      }
    },
    "/mcp/{name}/disconnect": {
      "post": {
        "operationId": "mcp.disconnect",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "name",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "description": "Disconnect an MCP server",
        "responses": {
          "200": {
            "description": "MCP server disconnected successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.disconnect({\n  ...\n})"
          }
        ]
      }
    },
    "/tui/append-prompt": {
      "post": {
        "operationId": "tui.appendPrompt",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Append TUI prompt",
        "description": "Append prompt to the TUI",
        "responses": {
          "200": {
            "description": "Prompt processed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string"
                  }
                },
                "required": [
                  "text"
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.appendPrompt({\n  ...\n})"
          }
        ]
      }
    },
    "/tui/open-help": {
      "post": {
        "operationId": "tui.openHelp",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Open help dialog",
        "description": "Open the help dialog in the TUI to display user assistance information.",
        "responses": {
          "200": {
            "description": "Help dialog opened successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openHelp({\n  ...\n})"
          }
        ]
      }
    },
    "/tui/open-sessions": {
      "post": {
        "operationId": "tui.openSessions",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Open sessions dialog",
        "description": "Open the session dialog",
        "responses": {
          "200": {
            "description": "Session dialog opened successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openSessions({\n  ...\n})"
          }
        ]
      }
    },
    "/tui/open-themes": {
      "post": {
        "operationId": "tui.openThemes",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Open themes dialog",
        "description": "Open the theme dialog",
        "responses": {
          "200": {
            "description": "Theme dialog opened successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openThemes({\n  ...\n})"
          }
        ]
      }
    },
    "/tui/open-models": {
      "post": {
        "operationId": "tui.openModels",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Open models dialog",
        "description": "Open the model dialog",
        "responses": {
          "200": {
            "description": "Model dialog opened successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openModels({\n  ...\n})"
          }
        ]
      }
    },
    "/tui/submit-prompt": {
      "post": {
        "operationId": "tui.submitPrompt",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Submit TUI prompt",
        "description": "Submit the prompt",
        "responses": {
          "200": {
            "description": "Prompt submitted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.submitPrompt({\n  ...\n})"
          }
        ]
      }
    },
    "/tui/clear-prompt": {
      "post": {
        "operationId": "tui.clearPrompt",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Clear TUI prompt",
        "description": "Clear the prompt",
        "responses": {
          "200": {
            "description": "Prompt cleared successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.clearPrompt({\n  ...\n})"
          }
        ]
      }
    },
    "/tui/execute-command": {
      "post": {
        "operationId": "tui.executeCommand",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Execute TUI command",
        "description": "Execute a TUI command (e.g. agent_cycle)",
        "responses": {
          "200": {
            "description": "Command executed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "command": {
                    "type": "string"
                  }
                },
                "required": [
                  "command"
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.executeCommand({\n  ...\n})"
          }
        ]
      }
    },
    "/tui/show-toast": {
      "post": {
        "operationId": "tui.showToast",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Show TUI toast",
        "description": "Show a toast notification in the TUI",
        "responses": {
          "200": {
            "description": "Toast notification shown successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string"
                  },
                  "variant": {
                    "type": "string",
                    "enum": [
                      "info",
                      "success",
                      "warning",
                      "error"
                    ]
                  },
                  "duration": {
                    "description": "Duration in milliseconds",
                    "default": 5000,
                    "type": "number"
                  }
                },
                "required": [
                  "message",
                  "variant"
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.showToast({\n  ...\n})"
          }
        ]
      }
    },
    "/tui/publish": {
      "post": {
        "operationId": "tui.publish",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Publish TUI event",
        "description": "Publish a TUI event",
        "responses": {
          "200": {
            "description": "Event published successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$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/Event.tui.instructions.loaded"
                  }
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.publish({\n  ...\n})"
          }
        ]
      }
    },
    "/tui/select-session": {
      "post": {
        "operationId": "tui.selectSession",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Select session",
        "description": "Navigate the TUI to display the specified session.",
        "responses": {
          "200": {
            "description": "Session selected successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sessionID": {
                    "description": "Session ID to navigate to",
                    "type": "string",
                    "pattern": "^ses.*"
                  }
                },
                "required": [
                  "sessionID"
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.selectSession({\n  ...\n})"
          }
        ]
      }
    },
    "/tui/control/next": {
      "get": {
        "operationId": "tui.control.next",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Get next TUI request",
        "description": "Retrieve the next TUI (Terminal User Interface) request from the queue for processing.",
        "responses": {
          "200": {
            "description": "Next TUI request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "path": {
                      "type": "string"
                    },
                    "body": {}
                  },
                  "required": [
                    "path",
                    "body"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.next({\n  ...\n})"
          }
        ]
      }
    },
    "/tui/control/response": {
      "post": {
        "operationId": "tui.control.response",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Submit TUI response",
        "description": "Submit a response to the TUI request queue to complete a pending request.",
        "responses": {
          "200": {
            "description": "Response submitted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.response({\n  ...\n})"
          }
        ]
      }
    },
    "/instance/dispose": {
      "post": {
        "operationId": "instance.dispose",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Dispose instance",
        "description": "Clean up and dispose the current OpenCode instance, releasing all resources.",
        "responses": {
          "200": {
            "description": "Instance disposed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.instance.dispose({\n  ...\n})"
          }
        ]
      }
    },
    "/path": {
      "get": {
        "operationId": "path.get",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Get paths",
        "description": "Retrieve the current working directory and related path information for the OpenCode instance.",
        "responses": {
          "200": {
            "description": "Path",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Path"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.path.get({\n  ...\n})"
          }
        ]
      }
    },
    "/vcs": {
      "get": {
        "operationId": "vcs.get",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Get VCS info",
        "description": "Retrieve version control system (VCS) information for the current project, such as git branch.",
        "responses": {
          "200": {
            "description": "VCS info",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VcsInfo"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.get({\n  ...\n})"
          }
        ]
      }
    },
    "/vcs/diff": {
      "get": {
        "operationId": "vcs.diff",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "mode",
            "schema": {
              "type": "string",
              "enum": [
                "git",
                "branch"
              ]
            },
            "required": true
          }
        ],
        "summary": "Get VCS diff",
        "description": "Retrieve the current git diff for the working tree or against the default branch.",
        "responses": {
          "200": {
            "description": "VCS diff",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VcsFileDiff"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.diff({\n  ...\n})"
          }
        ]
      }
    },
    "/command": {
      "get": {
        "operationId": "command.list",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "List commands",
        "description": "Get a list of all available commands in the OpenCode system.",
        "responses": {
          "200": {
            "description": "List of commands",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Command"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.command.list({\n  ...\n})"
          }
        ]
      }
    },
    "/agent": {
      "get": {
        "operationId": "app.agents",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "List agents",
        "description": "Get a list of all available AI agents in the OpenCode system.",
        "responses": {
          "200": {
            "description": "List of agents",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Agent"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.agents({\n  ...\n})"
          }
        ]
      }
    },
    "/skill": {
      "get": {
        "operationId": "app.skills",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "List skills",
        "description": "Get a list of all available skills in the OpenCode system.",
        "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"
                      },
                      "hidden": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "name",
                      "description",
                      "location",
                      "content"
                    ]
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.skills({\n  ...\n})"
          }
        ]
      }
    },
    "/lsp": {
      "get": {
        "operationId": "lsp.status",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Get LSP status",
        "description": "Get LSP server status",
        "responses": {
          "200": {
            "description": "LSP server status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LSPStatus"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.lsp.status({\n  ...\n})"
          }
        ]
      }
    },
    "/formatter": {
      "get": {
        "operationId": "formatter.status",
        "parameters": [
          {
            "in": "query",
            "name": "directory",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Get formatter status",
        "description": "Get formatter status",
        "responses": {
          "200": {
            "description": "Formatter status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FormatterStatus"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "js",
            "source": "import { createOpencodeClient } from \"@mimo-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.formatter.status({\n  ...\n})"
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "Project": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "worktree": {
            "type": "string"
          },
          "vcs": {
            "type": "string",
            "const": "git"
          },
          "name": {
            "type": "string"
          },
          "icon": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string"
              },
              "override": {
                "type": "string"
              },
              "color": {
                "type": "string"
              }
            }
          },
          "commands": {
            "type": "object",
            "properties": {
              "start": {
                "description": "Startup script to run when creating a new workspace (worktree)",
                "type": "string"
              }
            }
          },
          "time": {
            "type": "object",
            "properties": {
              "created": {
                "type": "number"
              },
              "updated": {
                "type": "number"
              },
              "initialized": {
                "type": "number"
              }
            },
            "required": [
              "created",
              "updated"
            ]
          },
          "sandboxes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "id",
          "worktree",
          "time",
          "sandboxes"
        ]
      },
      "Event.project.updated": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "project.updated"
          },
          "properties": {
            "$ref": "#/components/schemas/Project"
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.server.instance.disposed": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "server.instance.disposed"
          },
          "properties": {
            "type": "object",
            "properties": {
              "directory": {
                "type": "string"
              }
            },
            "required": [
              "directory"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.server.connected": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "server.connected"
          },
          "properties": {
            "type": "object",
            "properties": {}
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.global.disposed": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "global.disposed"
          },
          "properties": {
            "type": "object",
            "properties": {}
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.file.edited": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "file.edited"
          },
          "properties": {
            "type": "object",
            "properties": {
              "file": {
                "type": "string"
              }
            },
            "required": [
              "file"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.file.watcher.updated": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "file.watcher.updated"
          },
          "properties": {
            "type": "object",
            "properties": {
              "file": {
                "type": "string"
              },
              "event": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "add"
                  },
                  {
                    "type": "string",
                    "const": "change"
                  },
                  {
                    "type": "string",
                    "const": "unlink"
                  }
                ]
              }
            },
            "required": [
              "file",
              "event"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.lsp.client.diagnostics": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "lsp.client.diagnostics"
          },
          "properties": {
            "type": "object",
            "properties": {
              "serverID": {
                "type": "string"
              },
              "path": {
                "type": "string"
              }
            },
            "required": [
              "serverID",
              "path"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.lsp.updated": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "lsp.updated"
          },
          "properties": {
            "type": "object",
            "properties": {}
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.installation.updated": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "installation.updated"
          },
          "properties": {
            "type": "object",
            "properties": {
              "version": {
                "type": "string"
              }
            },
            "required": [
              "version"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.installation.update-available": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "installation.update-available"
          },
          "properties": {
            "type": "object",
            "properties": {
              "version": {
                "type": "string"
              }
            },
            "required": [
              "version"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.message.part.delta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "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"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "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",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "always": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tool": {
            "type": "object",
            "properties": {
              "messageID": {
                "type": "string",
                "pattern": "^msg.*"
              },
              "callID": {
                "type": "string"
              }
            },
            "required": [
              "messageID",
              "callID"
            ]
          }
        },
        "required": [
          "id",
          "sessionID",
          "permission",
          "patterns",
          "metadata",
          "always"
        ]
      },
      "Event.permission.asked": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "permission.asked"
          },
          "properties": {
            "$ref": "#/components/schemas/PermissionRequest"
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.permission.replied": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "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"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.actor.registered": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "actor.registered"
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses.*"
              },
              "actorID": {
                "type": "string"
              },
              "mode": {
                "type": "string",
                "enum": [
                  "peer",
                  "subagent",
                  "main"
                ]
              },
              "parentActorID": {
                "type": "string"
              },
              "description": {
                "type": "string"
              },
              "agent": {
                "type": "string"
              },
              "background": {
                "type": "boolean"
              }
            },
            "required": [
              "sessionID",
              "actorID",
              "mode",
              "description",
              "agent",
              "background"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.actor.status": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "actor.status"
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses.*"
              },
              "actorID": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "pending",
                  "running",
                  "idle"
                ]
              },
              "lastOutcome": {
                "type": "string",
                "enum": [
                  "success",
                  "failure",
                  "cancelled"
                ]
              },
              "turnCount": {
                "type": "number"
              },
              "lastTurnTime": {
                "type": "number"
              },
              "error": {
                "type": "string"
              }
            },
            "required": [
              "sessionID",
              "actorID",
              "status",
              "turnCount",
              "lastTurnTime"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.actor.stuck": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "actor.stuck"
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses.*"
              },
              "actorID": {
                "type": "string"
              },
              "description": {
                "type": "string"
              },
              "lastTurnTime": {
                "type": "number"
              },
              "stuckDuration": {
                "type": "number"
              }
            },
            "required": [
              "sessionID",
              "actorID",
              "description",
              "lastTurnTime",
              "stuckDuration"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.writer.cache_perf": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "writer.cache_perf"
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses.*"
              },
              "writerActorID": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "completed",
                  "failed"
                ]
              },
              "total_input_tokens": {
                "type": "number"
              },
              "cache_read_tokens": {
                "type": "number"
              },
              "cache_write_tokens": {
                "type": "number"
              },
              "cache_hit_rate": {
                "type": "number"
              },
              "num_llm_calls": {
                "type": "number"
              }
            },
            "required": [
              "sessionID",
              "writerActorID",
              "status",
              "total_input_tokens",
              "cache_read_tokens",
              "cache_write_tokens",
              "cache_hit_rate",
              "num_llm_calls"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.inbox.arrived": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "inbox.arrived"
          },
          "properties": {
            "type": "object",
            "properties": {
              "receiverSessionID": {
                "type": "string",
                "pattern": "^ses.*"
              },
              "receiverActorID": {
                "type": "string"
              },
              "senderSessionID": {
                "type": "string",
                "pattern": "^ses.*"
              },
              "senderActorID": {
                "type": "string"
              },
              "inboxID": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "receiverSessionID",
              "receiverActorID",
              "inboxID",
              "type"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "SnapshotFileDiff": {
        "type": "object",
        "properties": {
          "file": {
            "type": "string"
          },
          "patch": {
            "type": "string"
          },
          "additions": {
            "type": "number"
          },
          "deletions": {
            "type": "number"
          },
          "status": {
            "type": "string",
            "enum": [
              "added",
              "deleted",
              "modified"
            ]
          }
        },
        "required": [
          "file",
          "patch",
          "additions",
          "deletions"
        ]
      },
      "Event.session.diff": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "session.diff"
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses.*"
              },
              "diff": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SnapshotFileDiff"
                }
              }
            },
            "required": [
              "sessionID",
              "diff"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "ProviderAuthError": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "const": "ProviderAuthError"
          },
          "data": {
            "type": "object",
            "properties": {
              "providerID": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "providerID",
              "message"
            ]
          }
        },
        "required": [
          "name",
          "data"
        ]
      },
      "UnknownError": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "const": "UnknownError"
          },
          "data": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              }
            },
            "required": [
              "message"
            ]
          }
        },
        "required": [
          "name",
          "data"
        ]
      },
      "MessageOutputLengthError": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "const": "MessageOutputLengthError"
          },
          "data": {
            "type": "object",
            "properties": {}
          }
        },
        "required": [
          "name",
          "data"
        ]
      },
      "MessageAbortedError": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "const": "MessageAbortedError"
          },
          "data": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              }
            },
            "required": [
              "message"
            ]
          }
        },
        "required": [
          "name",
          "data"
        ]
      },
      "StructuredOutputError": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "const": "StructuredOutputError"
          },
          "data": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              },
              "retries": {
                "type": "number"
              }
            },
            "required": [
              "message",
              "retries"
            ]
          }
        },
        "required": [
          "name",
          "data"
        ]
      },
      "ContextOverflowError": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "const": "ContextOverflowError"
          },
          "data": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              },
              "responseBody": {
                "type": "string"
              }
            },
            "required": [
              "message"
            ]
          }
        },
        "required": [
          "name",
          "data"
        ]
      },
      "InvalidOutputError": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "const": "InvalidOutputError"
          },
          "data": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              }
            },
            "required": [
              "message"
            ]
          }
        },
        "required": [
          "name",
          "data"
        ]
      },
      "TextToolCallError": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "const": "TextToolCallError"
          },
          "data": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              }
            },
            "required": [
              "message"
            ]
          }
        },
        "required": [
          "name",
          "data"
        ]
      },
      "ContentFilterError": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "const": "ContentFilterError"
          },
          "data": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              }
            },
            "required": [
              "message"
            ]
          }
        },
        "required": [
          "name",
          "data"
        ]
      },
      "ModelError": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "const": "ModelError"
          },
          "data": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              }
            },
            "required": [
              "message"
            ]
          }
        },
        "required": [
          "name",
          "data"
        ]
      },
      "APIError": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "const": "APIError"
          },
          "data": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              },
              "statusCode": {
                "type": "number"
              },
              "isRetryable": {
                "type": "boolean"
              },
              "responseHeaders": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "string"
                }
              },
              "responseBody": {
                "type": "string"
              },
              "metadata": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "string"
                }
              }
            },
            "required": [
              "message",
              "isRetryable"
            ]
          }
        },
        "required": [
          "name",
          "data"
        ]
      },
      "Event.session.error": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "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/InvalidOutputError"
                  },
                  {
                    "$ref": "#/components/schemas/TextToolCallError"
                  },
                  {
                    "$ref": "#/components/schemas/ContentFilterError"
                  },
                  {
                    "$ref": "#/components/schemas/ModelError"
                  },
                  {
                    "$ref": "#/components/schemas/APIError"
                  }
                ]
              }
            }
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.session.retry.attempt": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "session.retry.attempt"
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses.*"
              },
              "messageID": {
                "type": "string"
              },
              "attempt": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "maxAttempts": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "reason": {
                "type": "string"
              },
              "nextDelayMs": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "sessionID",
              "messageID",
              "attempt",
              "maxAttempts",
              "reason",
              "nextDelayMs"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.hook.executed": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "hook.executed"
          },
          "properties": {
            "type": "object",
            "properties": {
              "event": {
                "type": "string",
                "enum": [
                  "actor.preStop",
                  "actor.postStop"
                ]
              },
              "hookID": {
                "type": "string"
              },
              "pluginName": {
                "type": "string"
              },
              "actorID": {
                "type": "string"
              },
              "agentType": {
                "type": "string"
              },
              "durationMs": {
                "type": "number"
              },
              "outcome": {
                "type": "string",
                "enum": [
                  "success",
                  "error",
                  "skipped"
                ]
              },
              "continueRequested": {
                "type": "boolean"
              },
              "reasonLength": {
                "type": "number"
              }
            },
            "required": [
              "event",
              "hookID",
              "pluginName",
              "actorID",
              "agentType",
              "durationMs",
              "outcome",
              "continueRequested",
              "reasonLength"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.hook.react.reentered": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "hook.react.reentered"
          },
          "properties": {
            "type": "object",
            "properties": {
              "phase": {
                "type": "string",
                "enum": [
                  "pre",
                  "post"
                ]
              },
              "actorID": {
                "type": "string"
              },
              "agentType": {
                "type": "string"
              },
              "iteration": {
                "type": "number"
              },
              "triggeredByPlugins": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "reasonPreview": {
                "type": "string"
              }
            },
            "required": [
              "phase",
              "actorID",
              "agentType",
              "iteration",
              "triggeredByPlugins",
              "reasonPreview"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.hook.react.max_reached": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "hook.react.max_reached"
          },
          "properties": {
            "type": "object",
            "properties": {
              "phase": {
                "type": "string",
                "enum": [
                  "pre",
                  "post"
                ]
              },
              "actorID": {
                "type": "string"
              },
              "agentType": {
                "type": "string"
              }
            },
            "required": [
              "phase",
              "actorID",
              "agentType"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "QuestionOption": {
        "type": "object",
        "properties": {
          "label": {
            "description": "Display text (1-5 words, concise)",
            "type": "string"
          },
          "description": {
            "description": "Explanation of choice",
            "type": "string"
          }
        },
        "required": [
          "label",
          "description"
        ]
      },
      "QuestionInfo": {
        "type": "object",
        "properties": {
          "question": {
            "description": "Complete question",
            "type": "string"
          },
          "header": {
            "description": "Very short label (max 30 chars)",
            "type": "string"
          },
          "options": {
            "description": "Available choices",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuestionOption"
            }
          },
          "multiple": {
            "description": "Allow selecting multiple choices",
            "type": "boolean"
          },
          "custom": {
            "description": "Allow typing a custom answer (default: true)",
            "type": "boolean"
          },
          "key": {
            "description": "i18n key for client-side translation (e.g. plan_exit). When set, clients may translate question/options text using this key as a namespace.",
            "type": "string"
          },
          "params": {
            "description": "Template parameters for i18n interpolation (e.g. { plan: '.mimocode/plans/...' })",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "required": [
          "question",
          "header",
          "options"
        ]
      },
      "QuestionTool": {
        "type": "object",
        "properties": {
          "messageID": {
            "type": "string",
            "pattern": "^msg.*"
          },
          "callID": {
            "type": "string"
          }
        },
        "required": [
          "messageID",
          "callID"
        ]
      },
      "QuestionRequest": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^que.*"
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses.*"
          },
          "questions": {
            "description": "Questions to ask",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuestionInfo"
            }
          },
          "tool": {
            "$ref": "#/components/schemas/QuestionTool"
          }
        },
        "required": [
          "id",
          "sessionID",
          "questions"
        ]
      },
      "Event.question.asked": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "question.asked"
          },
          "properties": {
            "$ref": "#/components/schemas/QuestionRequest"
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "QuestionAnswer": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "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"
        ]
      },
      "Event.question.replied": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "question.replied"
          },
          "properties": {
            "$ref": "#/components/schemas/QuestionReplied"
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "QuestionRejected": {
        "type": "object",
        "properties": {
          "sessionID": {
            "type": "string",
            "pattern": "^ses.*"
          },
          "requestID": {
            "type": "string",
            "pattern": "^que.*"
          }
        },
        "required": [
          "sessionID",
          "requestID"
        ]
      },
      "Event.question.rejected": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "question.rejected"
          },
          "properties": {
            "$ref": "#/components/schemas/QuestionRejected"
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.session.cwd": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "session.cwd"
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses.*"
              },
              "cwd": {
                "type": "string"
              }
            },
            "required": [
              "sessionID",
              "cwd"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.bash.interactive.asked": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "bash.interactive.asked"
          },
          "properties": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "command": {
                "type": "string"
              },
              "cwd": {
                "type": "string"
              },
              "env": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "string"
                }
              },
              "description": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "command",
              "cwd",
              "description"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.bash.interactive.replied": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "bash.interactive.replied"
          },
          "properties": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "output": {
                "type": "string"
              },
              "exitCode": {
                "type": "number"
              }
            },
            "required": [
              "id",
              "output",
              "exitCode"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.team.created": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "team.created"
          },
          "properties": {
            "type": "object",
            "properties": {
              "teamID": {
                "type": "string"
              },
              "creatorSessionID": {
                "type": "string",
                "pattern": "^ses.*"
              }
            },
            "required": [
              "teamID",
              "creatorSessionID"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.team.member.joined": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "team.member.joined"
          },
          "properties": {
            "type": "object",
            "properties": {
              "teamID": {
                "type": "string"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses.*"
              },
              "agent": {
                "type": "string"
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "teamID",
              "sessionID",
              "agent",
              "role"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.task.created": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "task.created"
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses.*"
              },
              "task": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^T\\d+(\\.\\d+)*$"
                  },
                  "session_id": {
                    "type": "string",
                    "pattern": "^ses.*"
                  },
                  "parent_task_id": {
                    "type": "string",
                    "pattern": "^T\\d+(\\.\\d+)*$"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "open",
                      "in_progress",
                      "blocked",
                      "done",
                      "abandoned"
                    ]
                  },
                  "summary": {
                    "type": "string"
                  },
                  "owner": {
                    "type": "string"
                  },
                  "created_at": {
                    "type": "number"
                  },
                  "last_event_at": {
                    "type": "number"
                  },
                  "ended_at": {
                    "type": "number"
                  },
                  "cleanup_after": {
                    "type": "number"
                  }
                },
                "required": [
                  "id",
                  "session_id",
                  "status",
                  "summary",
                  "created_at",
                  "last_event_at"
                ]
              }
            },
            "required": [
              "sessionID",
              "task"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.task.updated": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "task.updated"
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses.*"
              },
              "task": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^T\\d+(\\.\\d+)*$"
                  },
                  "session_id": {
                    "type": "string",
                    "pattern": "^ses.*"
                  },
                  "parent_task_id": {
                    "type": "string",
                    "pattern": "^T\\d+(\\.\\d+)*$"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "open",
                      "in_progress",
                      "blocked",
                      "done",
                      "abandoned"
                    ]
                  },
                  "summary": {
                    "type": "string"
                  },
                  "owner": {
                    "type": "string"
                  },
                  "created_at": {
                    "type": "number"
                  },
                  "last_event_at": {
                    "type": "number"
                  },
                  "ended_at": {
                    "type": "number"
                  },
                  "cleanup_after": {
                    "type": "number"
                  }
                },
                "required": [
                  "id",
                  "session_id",
                  "status",
                  "summary",
                  "created_at",
                  "last_event_at"
                ]
              },
              "kind": {
                "type": "string",
                "enum": [
                  "started",
                  "unstarted",
                  "blocked",
                  "unblocked",
                  "done",
                  "abandoned",
                  "renamed"
                ]
              }
            },
            "required": [
              "sessionID",
              "task",
              "kind"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Todo": {
        "type": "object",
        "properties": {
          "content": {
            "description": "Brief description of the task",
            "type": "string"
          },
          "status": {
            "description": "Current status of the task: pending, in_progress, completed, cancelled",
            "type": "string"
          }
        },
        "required": [
          "content",
          "status"
        ]
      },
      "Event.todo.updated": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "todo.updated"
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses.*"
              },
              "todos": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Todo"
                }
              }
            },
            "required": [
              "sessionID",
              "todos"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "SessionStatus": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "idle"
              }
            },
            "required": [
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "retry"
              },
              "attempt": {
                "type": "number"
              },
              "message": {
                "type": "string"
              },
              "next": {
                "type": "number"
              }
            },
            "required": [
              "type",
              "attempt",
              "message",
              "next"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "busy"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "type"
            ]
          }
        ]
      },
      "Event.session.status": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "session.status"
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses.*"
              },
              "status": {
                "$ref": "#/components/schemas/SessionStatus"
              }
            },
            "required": [
              "sessionID",
              "status"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.session.idle": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "session.idle"
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses.*"
              }
            },
            "required": [
              "sessionID"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.session.goal": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "session.goal"
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses.*"
              },
              "goal": {
                "type": "object",
                "properties": {
                  "condition": {
                    "type": "string"
                  }
                },
                "required": [
                  "condition"
                ]
              },
              "lastVerdict": {
                "type": "object",
                "properties": {
                  "ok": {
                    "type": "boolean"
                  },
                  "impossible": {
                    "type": "boolean"
                  },
                  "reason": {
                    "type": "string"
                  },
                  "attempt": {
                    "type": "number"
                  },
                  "messageID": {
                    "type": "string"
                  },
                  "error": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "ok",
                  "reason",
                  "attempt"
                ]
              }
            },
            "required": [
              "sessionID"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.metrics.model_call": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "metrics.model_call"
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string"
              },
              "finish_reason": {
                "type": "string"
              },
              "ttft_ms": {
                "type": "number"
              },
              "latency_ms": {
                "type": "number"
              },
              "cached_read_tokens": {
                "type": "number"
              },
              "model_id": {
                "type": "string"
              },
              "provider": {
                "type": "string"
              },
              "total_tokens_in": {
                "type": "number"
              },
              "total_tokens_out": {
                "type": "number"
              }
            },
            "required": [
              "sessionID",
              "finish_reason",
              "latency_ms",
              "cached_read_tokens",
              "model_id",
              "provider",
              "total_tokens_in",
              "total_tokens_out"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.metrics.tool_call": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "metrics.tool_call"
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string"
              },
              "tool_name": {
                "type": "string"
              },
              "input_bytes": {
                "type": "number"
              },
              "output_bytes": {
                "type": "number"
              },
              "tool_call_id": {
                "type": "string"
              },
              "tool_call_status": {
                "type": "string",
                "enum": [
                  "success",
                  "error"
                ]
              }
            },
            "required": [
              "sessionID",
              "tool_name",
              "input_bytes",
              "output_bytes",
              "tool_call_id",
              "tool_call_status"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.metrics.agent_request": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "metrics.agent_request"
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string"
              },
              "phase": {
                "type": "string"
              },
              "task_type": {
                "type": "string"
              },
              "surface": {
                "type": "string"
              },
              "total_tokens_in": {
                "type": "number"
              },
              "total_tokens_out": {
                "type": "number"
              },
              "files_changed": {
                "type": "number"
              },
              "validation_status": {
                "type": "string"
              }
            },
            "required": [
              "sessionID",
              "phase",
              "task_type",
              "surface",
              "total_tokens_in",
              "total_tokens_out",
              "files_changed",
              "validation_status"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.session.compacted": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "session.compacted"
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses.*"
              }
            },
            "required": [
              "sessionID"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.tui.prompt.append": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "tui.prompt.append"
          },
          "properties": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              }
            },
            "required": [
              "text"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.tui.command.execute": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "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"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.tui.toast.show": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "tui.toast.show"
          },
          "properties": {
            "type": "object",
            "properties": {
              "title": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "variant": {
                "type": "string",
                "enum": [
                  "info",
                  "success",
                  "warning",
                  "error"
                ]
              },
              "duration": {
                "description": "Duration in milliseconds",
                "default": 5000,
                "type": "number"
              }
            },
            "required": [
              "message",
              "variant"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.tui.session.select": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "tui.session.select"
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "description": "Session ID to navigate to",
                "type": "string",
                "pattern": "^ses.*"
              }
            },
            "required": [
              "sessionID"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.tui.instructions.loaded": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "tui.instructions.loaded"
          },
          "properties": {
            "type": "object",
            "properties": {
              "files": {
                "description": "Display labels of loaded instruction files: worktree-relative path, ~-path, or absolute",
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "files"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.mcp.tools.changed": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "mcp.tools.changed"
          },
          "properties": {
            "type": "object",
            "properties": {
              "server": {
                "type": "string"
              }
            },
            "required": [
              "server"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.mcp.browser.open.failed": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "mcp.browser.open.failed"
          },
          "properties": {
            "type": "object",
            "properties": {
              "mcpName": {
                "type": "string"
              },
              "url": {
                "type": "string"
              }
            },
            "required": [
              "mcpName",
              "url"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.command.executed": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "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"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.vcs.branch.updated": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "vcs.branch.updated"
          },
          "properties": {
            "type": "object",
            "properties": {
              "branch": {
                "type": "string"
              }
            }
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.worktree.ready": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "worktree.ready"
          },
          "properties": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "branch": {
                "type": "string"
              }
            },
            "required": [
              "name",
              "branch"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.worktree.failed": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "worktree.failed"
          },
          "properties": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              }
            },
            "required": [
              "message"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "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": "number"
          }
        },
        "required": [
          "id",
          "title",
          "command",
          "args",
          "cwd",
          "status",
          "pid"
        ]
      },
      "Event.pty.created": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "pty.created"
          },
          "properties": {
            "type": "object",
            "properties": {
              "info": {
                "$ref": "#/components/schemas/Pty"
              }
            },
            "required": [
              "info"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.pty.updated": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "pty.updated"
          },
          "properties": {
            "type": "object",
            "properties": {
              "info": {
                "$ref": "#/components/schemas/Pty"
              }
            },
            "required": [
              "info"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.pty.exited": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "pty.exited"
          },
          "properties": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^pty.*"
              },
              "exitCode": {
                "type": "number"
              }
            },
            "required": [
              "id",
              "exitCode"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.pty.deleted": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "pty.deleted"
          },
          "properties": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^pty.*"
              }
            },
            "required": [
              "id"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.workflow.phase": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "workflow.phase"
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses.*"
              },
              "runID": {
                "type": "string"
              },
              "title": {
                "type": "string"
              }
            },
            "required": [
              "sessionID",
              "runID",
              "title"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.workflow.log": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "workflow.log"
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses.*"
              },
              "runID": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "sessionID",
              "runID",
              "message"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.workflow.started": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "workflow.started"
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses.*"
              },
              "runID": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "sessionID",
              "runID",
              "name"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.workflow.finished": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "workflow.finished"
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses.*"
              },
              "runID": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "completed",
                  "failed",
                  "cancelled"
                ]
              },
              "error": {
                "type": "string"
              }
            },
            "required": [
              "sessionID",
              "runID",
              "status"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.workspace.ready": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "workspace.ready"
          },
          "properties": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.workspace.failed": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "workspace.failed"
          },
          "properties": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              }
            },
            "required": [
              "message"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.workspace.restore": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "workspace.restore"
          },
          "properties": {
            "type": "object",
            "properties": {
              "workspaceID": {
                "type": "string",
                "pattern": "^wrk.*"
              },
              "sessionID": {
                "type": "string",
                "pattern": "^ses.*"
              },
              "total": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "step": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "workspaceID",
              "sessionID",
              "total",
              "step"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.workspace.status": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "workspace.status"
          },
          "properties": {
            "type": "object",
            "properties": {
              "workspaceID": {
                "type": "string",
                "pattern": "^wrk.*"
              },
              "status": {
                "type": "string",
                "enum": [
                  "connected",
                  "connecting",
                  "disconnected",
                  "error"
                ]
              }
            },
            "required": [
              "workspaceID",
              "status"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "OutputFormatText": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "text"
          }
        },
        "required": [
          "type"
        ]
      },
      "JSONSchema": {
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {}
      },
      "OutputFormatJsonSchema": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "json_schema"
          },
          "schema": {
            "$ref": "#/components/schemas/JSONSchema"
          },
          "retryCount": {
            "default": 2,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "type",
          "schema"
        ]
      },
      "OutputFormat": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/OutputFormatText"
          },
          {
            "$ref": "#/components/schemas/OutputFormatJsonSchema"
          }
        ]
      },
      "Provenance": {
        "type": "object",
        "properties": {
          "hookPhase": {
            "type": "string",
            "enum": [
              "pre",
              "post"
            ]
          },
          "hookIteration": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "pluginNames": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "hookIDs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "hookPhase",
          "hookIteration",
          "pluginNames",
          "hookIDs"
        ]
      },
      "UserMessage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^msg.*"
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses.*"
          },
          "agentID": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "const": "user"
          },
          "time": {
            "type": "object",
            "properties": {
              "created": {
                "type": "number"
              }
            },
            "required": [
              "created"
            ]
          },
          "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"
            ]
          },
          "agent": {
            "type": "string"
          },
          "model": {
            "type": "object",
            "properties": {
              "providerID": {
                "type": "string"
              },
              "modelID": {
                "type": "string"
              },
              "variant": {
                "type": "string"
              }
            },
            "required": [
              "providerID",
              "modelID"
            ]
          },
          "system": {
            "type": "string"
          },
          "tools": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "boolean"
            }
          },
          "provenance": {
            "$ref": "#/components/schemas/Provenance"
          }
        },
        "required": [
          "id",
          "sessionID",
          "role",
          "time",
          "agent",
          "model"
        ]
      },
      "AssistantMessage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^msg.*"
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses.*"
          },
          "agentID": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "const": "assistant"
          },
          "time": {
            "type": "object",
            "properties": {
              "created": {
                "type": "number"
              },
              "completed": {
                "type": "number"
              }
            },
            "required": [
              "created"
            ]
          },
          "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/InvalidOutputError"
              },
              {
                "$ref": "#/components/schemas/TextToolCallError"
              },
              {
                "$ref": "#/components/schemas/ContentFilterError"
              },
              {
                "$ref": "#/components/schemas/ModelError"
              },
              {
                "$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"
            ]
          },
          "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"
                ]
              }
            },
            "required": [
              "input",
              "output",
              "reasoning",
              "cache"
            ]
          },
          "structured": {},
          "variant": {
            "type": "string"
          },
          "finish": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "sessionID",
          "role",
          "time",
          "parentID",
          "modelID",
          "providerID",
          "mode",
          "agent",
          "path",
          "cost",
          "tokens"
        ]
      },
      "Message": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/UserMessage"
          },
          {
            "$ref": "#/components/schemas/AssistantMessage"
          }
        ]
      },
      "Event.message.updated": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "message.updated"
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses.*"
              },
              "info": {
                "$ref": "#/components/schemas/Message"
              }
            },
            "required": [
              "sessionID",
              "info"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.message.removed": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "message.removed"
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses.*"
              },
              "messageID": {
                "type": "string",
                "pattern": "^msg.*"
              }
            },
            "required": [
              "sessionID",
              "messageID"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "TextPart": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prt.*"
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses.*"
          },
          "messageID": {
            "type": "string",
            "pattern": "^msg.*"
          },
          "type": {
            "type": "string",
            "const": "text"
          },
          "text": {
            "type": "string"
          },
          "synthetic": {
            "type": "boolean"
          },
          "ignored": {
            "type": "boolean"
          },
          "time": {
            "type": "object",
            "properties": {
              "start": {
                "type": "number"
              },
              "end": {
                "type": "number"
              }
            },
            "required": [
              "start"
            ]
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "required": [
          "id",
          "sessionID",
          "messageID",
          "type",
          "text"
        ]
      },
      "SubtaskPart": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prt.*"
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses.*"
          },
          "messageID": {
            "type": "string",
            "pattern": "^msg.*"
          },
          "type": {
            "type": "string",
            "const": "subtask"
          },
          "prompt": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "agent": {
            "type": "string"
          },
          "model": {
            "type": "object",
            "properties": {
              "providerID": {
                "type": "string"
              },
              "modelID": {
                "type": "string"
              }
            },
            "required": [
              "providerID",
              "modelID"
            ]
          },
          "command": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "sessionID",
          "messageID",
          "type",
          "prompt",
          "description",
          "agent"
        ]
      },
      "ReasoningPart": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prt.*"
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses.*"
          },
          "messageID": {
            "type": "string",
            "pattern": "^msg.*"
          },
          "type": {
            "type": "string",
            "const": "reasoning"
          },
          "text": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "time": {
            "type": "object",
            "properties": {
              "start": {
                "type": "number"
              },
              "end": {
                "type": "number"
              }
            },
            "required": [
              "start"
            ]
          }
        },
        "required": [
          "id",
          "sessionID",
          "messageID",
          "type",
          "text",
          "time"
        ]
      },
      "FilePartSourceText": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string"
          },
          "start": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "end": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "value",
          "start",
          "end"
        ]
      },
      "FileSource": {
        "type": "object",
        "properties": {
          "text": {
            "$ref": "#/components/schemas/FilePartSourceText"
          },
          "type": {
            "type": "string",
            "const": "file"
          },
          "path": {
            "type": "string"
          }
        },
        "required": [
          "text",
          "type",
          "path"
        ]
      },
      "Range": {
        "type": "object",
        "properties": {
          "start": {
            "type": "object",
            "properties": {
              "line": {
                "type": "number"
              },
              "character": {
                "type": "number"
              }
            },
            "required": [
              "line",
              "character"
            ]
          },
          "end": {
            "type": "object",
            "properties": {
              "line": {
                "type": "number"
              },
              "character": {
                "type": "number"
              }
            },
            "required": [
              "line",
              "character"
            ]
          }
        },
        "required": [
          "start",
          "end"
        ]
      },
      "SymbolSource": {
        "type": "object",
        "properties": {
          "text": {
            "$ref": "#/components/schemas/FilePartSourceText"
          },
          "type": {
            "type": "string",
            "const": "symbol"
          },
          "path": {
            "type": "string"
          },
          "range": {
            "$ref": "#/components/schemas/Range"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "text",
          "type",
          "path",
          "range",
          "name",
          "kind"
        ]
      },
      "ResourceSource": {
        "type": "object",
        "properties": {
          "text": {
            "$ref": "#/components/schemas/FilePartSourceText"
          },
          "type": {
            "type": "string",
            "const": "resource"
          },
          "clientName": {
            "type": "string"
          },
          "uri": {
            "type": "string"
          }
        },
        "required": [
          "text",
          "type",
          "clientName",
          "uri"
        ]
      },
      "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",
            "const": "file"
          },
          "mime": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "source": {
            "$ref": "#/components/schemas/FilePartSource"
          }
        },
        "required": [
          "id",
          "sessionID",
          "messageID",
          "type",
          "mime",
          "url"
        ]
      },
      "ToolStatePending": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "const": "pending"
          },
          "input": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "raw": {
            "type": "string"
          }
        },
        "required": [
          "status",
          "input",
          "raw"
        ]
      },
      "ToolStateRunning": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "const": "running"
          },
          "input": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "title": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "time": {
            "type": "object",
            "properties": {
              "start": {
                "type": "number"
              }
            },
            "required": [
              "start"
            ]
          }
        },
        "required": [
          "status",
          "input",
          "time"
        ]
      },
      "ToolStateCompleted": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "const": "completed"
          },
          "input": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "output": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "time": {
            "type": "object",
            "properties": {
              "start": {
                "type": "number"
              },
              "end": {
                "type": "number"
              },
              "compacted": {
                "type": "number"
              }
            },
            "required": [
              "start",
              "end"
            ]
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FilePart"
            }
          }
        },
        "required": [
          "status",
          "input",
          "output",
          "title",
          "metadata",
          "time"
        ]
      },
      "ToolStateError": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "const": "error"
          },
          "input": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "error": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "time": {
            "type": "object",
            "properties": {
              "start": {
                "type": "number"
              },
              "end": {
                "type": "number"
              }
            },
            "required": [
              "start",
              "end"
            ]
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FilePart"
            }
          }
        },
        "required": [
          "status",
          "input",
          "error",
          "time"
        ]
      },
      "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",
            "const": "tool"
          },
          "callID": {
            "type": "string"
          },
          "tool": {
            "type": "string"
          },
          "state": {
            "$ref": "#/components/schemas/ToolState"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "required": [
          "id",
          "sessionID",
          "messageID",
          "type",
          "callID",
          "tool",
          "state"
        ]
      },
      "StepStartPart": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prt.*"
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses.*"
          },
          "messageID": {
            "type": "string",
            "pattern": "^msg.*"
          },
          "type": {
            "type": "string",
            "const": "step-start"
          },
          "snapshot": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "sessionID",
          "messageID",
          "type"
        ]
      },
      "StepFinishPart": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prt.*"
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses.*"
          },
          "messageID": {
            "type": "string",
            "pattern": "^msg.*"
          },
          "type": {
            "type": "string",
            "const": "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"
                ]
              }
            },
            "required": [
              "input",
              "output",
              "reasoning",
              "cache"
            ]
          }
        },
        "required": [
          "id",
          "sessionID",
          "messageID",
          "type",
          "reason",
          "cost",
          "tokens"
        ]
      },
      "SnapshotPart": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prt.*"
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses.*"
          },
          "messageID": {
            "type": "string",
            "pattern": "^msg.*"
          },
          "type": {
            "type": "string",
            "const": "snapshot"
          },
          "snapshot": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "sessionID",
          "messageID",
          "type",
          "snapshot"
        ]
      },
      "PatchPart": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prt.*"
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses.*"
          },
          "messageID": {
            "type": "string",
            "pattern": "^msg.*"
          },
          "type": {
            "type": "string",
            "const": "patch"
          },
          "hash": {
            "type": "string"
          },
          "files": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "id",
          "sessionID",
          "messageID",
          "type",
          "hash",
          "files"
        ]
      },
      "AgentPart": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prt.*"
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses.*"
          },
          "messageID": {
            "type": "string",
            "pattern": "^msg.*"
          },
          "type": {
            "type": "string",
            "const": "agent"
          },
          "name": {
            "type": "string"
          },
          "source": {
            "type": "object",
            "properties": {
              "value": {
                "type": "string"
              },
              "start": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "end": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "value",
              "start",
              "end"
            ]
          }
        },
        "required": [
          "id",
          "sessionID",
          "messageID",
          "type",
          "name"
        ]
      },
      "RetryPart": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prt.*"
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses.*"
          },
          "messageID": {
            "type": "string",
            "pattern": "^msg.*"
          },
          "type": {
            "type": "string",
            "const": "retry"
          },
          "attempt": {
            "type": "number"
          },
          "error": {
            "$ref": "#/components/schemas/APIError"
          },
          "time": {
            "type": "object",
            "properties": {
              "created": {
                "type": "number"
              }
            },
            "required": [
              "created"
            ]
          }
        },
        "required": [
          "id",
          "sessionID",
          "messageID",
          "type",
          "attempt",
          "error",
          "time"
        ]
      },
      "CheckpointPart": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prt.*"
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses.*"
          },
          "messageID": {
            "type": "string",
            "pattern": "^msg.*"
          },
          "type": {
            "type": "string",
            "const": "checkpoint"
          },
          "checkpointDir": {
            "type": "string"
          },
          "checkpointNumber": {
            "type": "number"
          },
          "coveredUpTo": {
            "type": "string",
            "pattern": "^msg.*"
          }
        },
        "required": [
          "id",
          "sessionID",
          "messageID",
          "type",
          "checkpointDir",
          "checkpointNumber",
          "coveredUpTo"
        ]
      },
      "CompactionPart": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prt.*"
          },
          "sessionID": {
            "type": "string",
            "pattern": "^ses.*"
          },
          "messageID": {
            "type": "string",
            "pattern": "^msg.*"
          },
          "type": {
            "type": "string",
            "const": "compaction"
          },
          "auto": {
            "type": "boolean"
          },
          "overflow": {
            "type": "boolean"
          },
          "tail_start_id": {
            "type": "string",
            "pattern": "^msg.*"
          }
        },
        "required": [
          "id",
          "sessionID",
          "messageID",
          "type",
          "auto"
        ]
      },
      "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/CheckpointPart"
          },
          {
            "$ref": "#/components/schemas/CompactionPart"
          }
        ]
      },
      "Event.message.part.updated": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "message.part.updated"
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses.*"
              },
              "part": {
                "$ref": "#/components/schemas/Part"
              },
              "time": {
                "type": "number"
              }
            },
            "required": [
              "sessionID",
              "part",
              "time"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.message.part.removed": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "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"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "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"
        ]
      },
      "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"
          },
          "parentID": {
            "type": "string",
            "pattern": "^ses.*"
          },
          "contextFrom": {
            "type": "string",
            "pattern": "^ses.*"
          },
          "contextWatermark": {
            "type": "string",
            "pattern": "^msg.*"
          },
          "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"
            ]
          },
          "share": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string"
              }
            },
            "required": [
              "url"
            ]
          },
          "title": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "time": {
            "type": "object",
            "properties": {
              "created": {
                "type": "number"
              },
              "updated": {
                "type": "number"
              },
              "compacting": {
                "type": "number"
              },
              "archived": {
                "type": "number"
              }
            },
            "required": [
              "created",
              "updated"
            ]
          },
          "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"
            ]
          }
        },
        "required": [
          "id",
          "slug",
          "projectID",
          "directory",
          "title",
          "version",
          "time"
        ]
      },
      "Event.session.created": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "session.created"
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses.*"
              },
              "info": {
                "$ref": "#/components/schemas/Session"
              }
            },
            "required": [
              "sessionID",
              "info"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.session.updated": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "session.updated"
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses.*"
              },
              "info": {
                "$ref": "#/components/schemas/Session"
              }
            },
            "required": [
              "sessionID",
              "info"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "Event.session.deleted": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "session.deleted"
          },
          "properties": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses.*"
              },
              "info": {
                "$ref": "#/components/schemas/Session"
              }
            },
            "required": [
              "sessionID",
              "info"
            ]
          }
        },
        "required": [
          "type",
          "properties"
        ]
      },
      "SyncEvent.message.updated": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "sync"
          },
          "name": {
            "type": "string",
            "const": "message.updated.1"
          },
          "id": {
            "type": "string"
          },
          "seq": {
            "type": "number"
          },
          "aggregateID": {
            "type": "string",
            "const": "sessionID"
          },
          "data": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses.*"
              },
              "info": {
                "$ref": "#/components/schemas/Message"
              }
            },
            "required": [
              "sessionID",
              "info"
            ]
          }
        },
        "required": [
          "type",
          "name",
          "id",
          "seq",
          "aggregateID",
          "data"
        ]
      },
      "SyncEvent.message.removed": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "sync"
          },
          "name": {
            "type": "string",
            "const": "message.removed.1"
          },
          "id": {
            "type": "string"
          },
          "seq": {
            "type": "number"
          },
          "aggregateID": {
            "type": "string",
            "const": "sessionID"
          },
          "data": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses.*"
              },
              "messageID": {
                "type": "string",
                "pattern": "^msg.*"
              }
            },
            "required": [
              "sessionID",
              "messageID"
            ]
          }
        },
        "required": [
          "type",
          "name",
          "id",
          "seq",
          "aggregateID",
          "data"
        ]
      },
      "SyncEvent.message.part.updated": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "sync"
          },
          "name": {
            "type": "string",
            "const": "message.part.updated.1"
          },
          "id": {
            "type": "string"
          },
          "seq": {
            "type": "number"
          },
          "aggregateID": {
            "type": "string",
            "const": "sessionID"
          },
          "data": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses.*"
              },
              "part": {
                "$ref": "#/components/schemas/Part"
              },
              "time": {
                "type": "number"
              }
            },
            "required": [
              "sessionID",
              "part",
              "time"
            ]
          }
        },
        "required": [
          "type",
          "name",
          "id",
          "seq",
          "aggregateID",
          "data"
        ]
      },
      "SyncEvent.message.part.removed": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "sync"
          },
          "name": {
            "type": "string",
            "const": "message.part.removed.1"
          },
          "id": {
            "type": "string"
          },
          "seq": {
            "type": "number"
          },
          "aggregateID": {
            "type": "string",
            "const": "sessionID"
          },
          "data": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses.*"
              },
              "messageID": {
                "type": "string",
                "pattern": "^msg.*"
              },
              "partID": {
                "type": "string",
                "pattern": "^prt.*"
              }
            },
            "required": [
              "sessionID",
              "messageID",
              "partID"
            ]
          }
        },
        "required": [
          "type",
          "name",
          "id",
          "seq",
          "aggregateID",
          "data"
        ]
      },
      "SyncEvent.session.created": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "sync"
          },
          "name": {
            "type": "string",
            "const": "session.created.1"
          },
          "id": {
            "type": "string"
          },
          "seq": {
            "type": "number"
          },
          "aggregateID": {
            "type": "string",
            "const": "sessionID"
          },
          "data": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses.*"
              },
              "info": {
                "$ref": "#/components/schemas/Session"
              }
            },
            "required": [
              "sessionID",
              "info"
            ]
          }
        },
        "required": [
          "type",
          "name",
          "id",
          "seq",
          "aggregateID",
          "data"
        ]
      },
      "SyncEvent.session.updated": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "sync"
          },
          "name": {
            "type": "string",
            "const": "session.updated.1"
          },
          "id": {
            "type": "string"
          },
          "seq": {
            "type": "number"
          },
          "aggregateID": {
            "type": "string",
            "const": "sessionID"
          },
          "data": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses.*"
              },
              "info": {
                "type": "object",
                "properties": {
                  "id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^ses.*"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "slug": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "projectID": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "workspaceID": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^wrk.*"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "directory": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "parentID": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^ses.*"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "contextFrom": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^ses.*"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "contextWatermark": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^msg.*"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "summary": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "additions": {
                            "type": "number"
                          },
                          "deletions": {
                            "type": "number"
                          },
                          "files": {
                            "type": "number"
                          },
                          "diffs": {
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/SnapshotFileDiff"
                            }
                          }
                        },
                        "required": [
                          "additions",
                          "deletions",
                          "files"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "share": {
                    "type": "object",
                    "properties": {
                      "url": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "url"
                    ]
                  },
                  "title": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "version": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "time": {
                    "type": "object",
                    "properties": {
                      "created": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "updated": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "compacting": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "archived": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "created",
                      "updated",
                      "compacting",
                      "archived"
                    ]
                  },
                  "permission": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/PermissionRuleset"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "revert": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "messageID": {
                            "type": "string",
                            "pattern": "^msg.*"
                          },
                          "partID": {
                            "type": "string",
                            "pattern": "^prt.*"
                          },
                          "snapshot": {
                            "type": "string"
                          },
                          "diff": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "messageID"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "id",
                  "slug",
                  "projectID",
                  "workspaceID",
                  "directory",
                  "parentID",
                  "contextFrom",
                  "contextWatermark",
                  "summary",
                  "title",
                  "version",
                  "permission",
                  "revert"
                ]
              }
            },
            "required": [
              "sessionID",
              "info"
            ]
          }
        },
        "required": [
          "type",
          "name",
          "id",
          "seq",
          "aggregateID",
          "data"
        ]
      },
      "SyncEvent.session.deleted": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "sync"
          },
          "name": {
            "type": "string",
            "const": "session.deleted.1"
          },
          "id": {
            "type": "string"
          },
          "seq": {
            "type": "number"
          },
          "aggregateID": {
            "type": "string",
            "const": "sessionID"
          },
          "data": {
            "type": "object",
            "properties": {
              "sessionID": {
                "type": "string",
                "pattern": "^ses.*"
              },
              "info": {
                "$ref": "#/components/schemas/Session"
              }
            },
            "required": [
              "sessionID",
              "info"
            ]
          }
        },
        "required": [
          "type",
          "name",
          "id",
          "seq",
          "aggregateID",
          "data"
        ]
      },
      "GlobalEvent": {
        "type": "object",
        "properties": {
          "directory": {
            "type": "string"
          },
          "project": {
            "type": "string"
          },
          "workspace": {
            "type": "string"
          },
          "payload": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Event.project.updated"
              },
              {
                "$ref": "#/components/schemas/Event.server.instance.disposed"
              },
              {
                "$ref": "#/components/schemas/Event.server.connected"
              },
              {
                "$ref": "#/components/schemas/Event.global.disposed"
              },
              {
                "$ref": "#/components/schemas/Event.file.edited"
              },
              {
                "$ref": "#/components/schemas/Event.file.watcher.updated"
              },
              {
                "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
              },
              {
                "$ref": "#/components/schemas/Event.lsp.updated"
              },
              {
                "$ref": "#/components/schemas/Event.installation.updated"
              },
              {
                "$ref": "#/components/schemas/Event.installation.update-available"
              },
              {
                "$ref": "#/components/schemas/Event.message.part.delta"
              },
              {
                "$ref": "#/components/schemas/Event.permission.asked"
              },
              {
                "$ref": "#/components/schemas/Event.permission.replied"
              },
              {
                "$ref": "#/components/schemas/Event.actor.registered"
              },
              {
                "$ref": "#/components/schemas/Event.actor.status"
              },
              {
                "$ref": "#/components/schemas/Event.actor.stuck"
              },
              {
                "$ref": "#/components/schemas/Event.writer.cache_perf"
              },
              {
                "$ref": "#/components/schemas/Event.inbox.arrived"
              },
              {
                "$ref": "#/components/schemas/Event.session.diff"
              },
              {
                "$ref": "#/components/schemas/Event.session.error"
              },
              {
                "$ref": "#/components/schemas/Event.session.retry.attempt"
              },
              {
                "$ref": "#/components/schemas/Event.hook.executed"
              },
              {
                "$ref": "#/components/schemas/Event.hook.react.reentered"
              },
              {
                "$ref": "#/components/schemas/Event.hook.react.max_reached"
              },
              {
                "$ref": "#/components/schemas/Event.question.asked"
              },
              {
                "$ref": "#/components/schemas/Event.question.replied"
              },
              {
                "$ref": "#/components/schemas/Event.question.rejected"
              },
              {
                "$ref": "#/components/schemas/Event.session.cwd"
              },
              {
                "$ref": "#/components/schemas/Event.bash.interactive.asked"
              },
              {
                "$ref": "#/components/schemas/Event.bash.interactive.replied"
              },
              {
                "$ref": "#/components/schemas/Event.team.created"
              },
              {
                "$ref": "#/components/schemas/Event.team.member.joined"
              },
              {
                "$ref": "#/components/schemas/Event.task.created"
              },
              {
                "$ref": "#/components/schemas/Event.task.updated"
              },
              {
                "$ref": "#/components/schemas/Event.todo.updated"
              },
              {
                "$ref": "#/components/schemas/Event.session.status"
              },
              {
                "$ref": "#/components/schemas/Event.session.idle"
              },
              {
                "$ref": "#/components/schemas/Event.session.goal"
              },
              {
                "$ref": "#/components/schemas/Event.metrics.model_call"
              },
              {
                "$ref": "#/components/schemas/Event.metrics.tool_call"
              },
              {
                "$ref": "#/components/schemas/Event.metrics.agent_request"
              },
              {
                "$ref": "#/components/schemas/Event.session.compacted"
              },
              {
                "$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/Event.tui.instructions.loaded"
              },
              {
                "$ref": "#/components/schemas/Event.mcp.tools.changed"
              },
              {
                "$ref": "#/components/schemas/Event.mcp.browser.open.failed"
              },
              {
                "$ref": "#/components/schemas/Event.command.executed"
              },
              {
                "$ref": "#/components/schemas/Event.vcs.branch.updated"
              },
              {
                "$ref": "#/components/schemas/Event.worktree.ready"
              },
              {
                "$ref": "#/components/schemas/Event.worktree.failed"
              },
              {
                "$ref": "#/components/schemas/Event.pty.created"
              },
              {
                "$ref": "#/components/schemas/Event.pty.updated"
              },
              {
                "$ref": "#/components/schemas/Event.pty.exited"
              },
              {
                "$ref": "#/components/schemas/Event.pty.deleted"
              },
              {
                "$ref": "#/components/schemas/Event.workflow.phase"
              },
              {
                "$ref": "#/components/schemas/Event.workflow.log"
              },
              {
                "$ref": "#/components/schemas/Event.workflow.started"
              },
              {
                "$ref": "#/components/schemas/Event.workflow.finished"
              },
              {
                "$ref": "#/components/schemas/Event.workspace.ready"
              },
              {
                "$ref": "#/components/schemas/Event.workspace.failed"
              },
              {
                "$ref": "#/components/schemas/Event.workspace.restore"
              },
              {
                "$ref": "#/components/schemas/Event.workspace.status"
              },
              {
                "$ref": "#/components/schemas/Event.message.updated"
              },
              {
                "$ref": "#/components/schemas/Event.message.removed"
              },
              {
                "$ref": "#/components/schemas/Event.message.part.updated"
              },
              {
                "$ref": "#/components/schemas/Event.message.part.removed"
              },
              {
                "$ref": "#/components/schemas/Event.session.created"
              },
              {
                "$ref": "#/components/schemas/Event.session.updated"
              },
              {
                "$ref": "#/components/schemas/Event.session.deleted"
              },
              {
                "$ref": "#/components/schemas/SyncEvent.message.updated"
              },
              {
                "$ref": "#/components/schemas/SyncEvent.message.removed"
              },
              {
                "$ref": "#/components/schemas/SyncEvent.message.part.updated"
              },
              {
                "$ref": "#/components/schemas/SyncEvent.message.part.removed"
              },
              {
                "$ref": "#/components/schemas/SyncEvent.session.created"
              },
              {
                "$ref": "#/components/schemas/SyncEvent.session.updated"
              },
              {
                "$ref": "#/components/schemas/SyncEvent.session.deleted"
              }
            ]
          }
        },
        "required": [
          "directory",
          "payload"
        ]
      },
      "LogLevel": {
        "description": "Log level",
        "type": "string",
        "enum": [
          "DEBUG",
          "INFO",
          "WARN",
          "ERROR"
        ]
      },
      "ServerConfig": {
        "description": "Server configuration for mimo serve and web commands",
        "type": "object",
        "properties": {
          "port": {
            "description": "Port to listen on",
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "hostname": {
            "description": "Hostname to listen on",
            "type": "string"
          },
          "mdns": {
            "description": "Enable mDNS service discovery",
            "type": "boolean"
          },
          "mdnsDomain": {
            "description": "Custom domain name for mDNS service (default: opencode.local)",
            "type": "string"
          },
          "cors": {
            "description": "Additional domains to allow for CORS",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "PermissionActionConfig": {
        "type": "string",
        "enum": [
          "ask",
          "allow",
          "deny"
        ]
      },
      "PermissionObjectConfig": {
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {
          "$ref": "#/components/schemas/PermissionActionConfig"
        }
      },
      "PermissionRuleConfig": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/PermissionActionConfig"
          },
          {
            "$ref": "#/components/schemas/PermissionObjectConfig"
          }
        ]
      },
      "PermissionConfig": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "__originalKeys": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "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"
              },
              "actor": {
                "$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"
              },
              "codesearch": {
                "$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"
            }
          },
          {
            "$ref": "#/components/schemas/PermissionActionConfig"
          }
        ]
      },
      "AgentConfig": {
        "type": "object",
        "properties": {
          "model": {
            "description": "Model for this agent: a literal provider/model (e.g. anthropic/claude-opus-4-8) or a tier/group name (e.g. ultra/standard/lite). Names without a '/' are resolved as model groups, provider-aware, at spawn time.",
            "type": "string"
          },
          "variant": {
            "description": "Default model variant for this agent (applies only when using the agent's configured model).",
            "type": "string"
          },
          "temperature": {
            "type": "number"
          },
          "top_p": {
            "type": "number"
          },
          "prompt": {
            "type": "string"
          },
          "tools": {
            "description": "@deprecated Use 'permission' field instead",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "boolean"
            }
          },
          "disable": {
            "type": "boolean"
          },
          "description": {
            "description": "Description of when to use the agent",
            "type": "string"
          },
          "mode": {
            "type": "string",
            "enum": [
              "subagent",
              "primary",
              "all"
            ]
          },
          "hidden": {
            "description": "Hide this subagent from the @ autocomplete menu (default: false, only applies to mode: subagent)",
            "type": "boolean"
          },
          "options": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "color": {
            "description": "Hex color code (e.g., #FF5733) or theme color (e.g., primary)",
            "anyOf": [
              {
                "type": "string",
                "pattern": "^#[0-9a-fA-F]{6}$"
              },
              {
                "type": "string",
                "enum": [
                  "primary",
                  "secondary",
                  "accent",
                  "success",
                  "warning",
                  "error",
                  "info"
                ]
              }
            ]
          },
          "steps": {
            "description": "Maximum number of agentic iterations before forcing text-only response",
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "tool_allowlist": {
            "description": "Optional list of tool IDs allowed for this agent. When set, only these tools are available.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "maxSteps": {
            "description": "@deprecated Use 'steps' field instead.",
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "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": {
                "description": "GitHub Enterprise URL for copilot authentication",
                "type": "string"
              },
              "setCacheKey": {
                "description": "Enable promptCacheKey for this provider (default false)",
                "type": "boolean"
              },
              "timeout": {
                "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
                "anyOf": [
                  {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "boolean",
                    "const": false
                  }
                ]
              },
              "chunkTimeout": {
                "description": "Timeout in milliseconds between streamed SSE chunks for this provider. If no chunk arrives within this window, the request is aborted.",
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              }
            },
            "additionalProperties": {}
          },
          "models": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "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",
                      "const": true
                    },
                    {
                      "type": "object",
                      "properties": {
                        "field": {
                          "type": "string",
                          "enum": [
                            "reasoning_content",
                            "reasoning_details"
                          ]
                        }
                      },
                      "required": [
                        "field"
                      ]
                    }
                  ]
                },
                "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"
                      ]
                    }
                  },
                  "required": [
                    "input",
                    "output"
                  ]
                },
                "limit": {
                  "type": "object",
                  "properties": {
                    "context": {
                      "type": "number"
                    },
                    "input": {
                      "type": "number"
                    },
                    "output": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "context",
                    "output"
                  ]
                },
                "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"
                        ]
                      }
                    }
                  },
                  "required": [
                    "input",
                    "output"
                  ]
                },
                "experimental": {
                  "type": "boolean"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "alpha",
                    "beta",
                    "deprecated"
                  ]
                },
                "cachePromptTTL": {
                  "description": "Prompt-cache breakpoint TTL for Anthropic/OpenRouter. '1h' keeps the cached prefix alive for one hour (2x write cost) instead of the 5m default. Ignored by providers whose SDK doesn't support a cache TTL.",
                  "type": "string",
                  "enum": [
                    "5m",
                    "1h"
                  ]
                },
                "provider": {
                  "type": "object",
                  "properties": {
                    "npm": {
                      "type": "string"
                    },
                    "api": {
                      "type": "string"
                    }
                  }
                },
                "options": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {}
                },
                "headers": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {
                    "type": "string"
                  }
                },
                "variants": {
                  "description": "Variant-specific configuration",
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {
                    "type": "object",
                    "properties": {
                      "disabled": {
                        "description": "Disable this variant for the model",
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": {}
                  }
                }
              }
            }
          }
        }
      },
      "McpLocalConfig": {
        "type": "object",
        "properties": {
          "type": {
            "description": "Type of MCP server connection",
            "type": "string",
            "const": "local"
          },
          "command": {
            "description": "Command and arguments to run the MCP server",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "environment": {
            "description": "Environment variables to set when running the MCP server",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "enabled": {
            "description": "Enable or disable the MCP server on startup",
            "type": "boolean"
          },
          "timeout": {
            "description": "Timeout in ms for MCP server requests. Defaults to 5000 (5 seconds) if not specified.",
            "type": "number"
          }
        },
        "required": [
          "type",
          "command"
        ]
      },
      "McpOAuthConfig": {
        "type": "object",
        "properties": {
          "clientId": {
            "description": "OAuth client ID. If not provided, dynamic client registration (RFC 7591) will be attempted.",
            "type": "string"
          },
          "clientSecret": {
            "description": "OAuth client secret (if required by the authorization server)",
            "type": "string"
          },
          "scope": {
            "description": "OAuth scopes to request during authorization",
            "type": "string"
          },
          "redirectUri": {
            "description": "OAuth redirect URI (default: http://127.0.0.1:19876/mcp/oauth/callback).",
            "type": "string"
          }
        }
      },
      "McpRemoteConfig": {
        "type": "object",
        "properties": {
          "type": {
            "description": "Type of MCP server connection",
            "type": "string",
            "const": "remote"
          },
          "url": {
            "description": "URL of the remote MCP server",
            "type": "string"
          },
          "enabled": {
            "description": "Enable or disable the MCP server on startup",
            "type": "boolean"
          },
          "headers": {
            "description": "Headers to send with the request",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "oauth": {
            "description": "OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection.",
            "anyOf": [
              {
                "$ref": "#/components/schemas/McpOAuthConfig"
              },
              {
                "type": "boolean",
                "const": false
              }
            ]
          },
          "timeout": {
            "description": "Timeout in ms for MCP server requests. Defaults to 5000 (5 seconds) if not specified.",
            "type": "number"
          }
        },
        "required": [
          "type",
          "url"
        ]
      },
      "LayoutConfig": {
        "description": "@deprecated Always uses stretch layout.",
        "type": "string",
        "enum": [
          "auto",
          "stretch"
        ]
      },
      "Config": {
        "type": "object",
        "properties": {
          "$schema": {
            "description": "JSON schema reference for configuration validation",
            "type": "string"
          },
          "logLevel": {
            "$ref": "#/components/schemas/LogLevel"
          },
          "server": {
            "$ref": "#/components/schemas/ServerConfig"
          },
          "command": {
            "description": "Command configuration, see https://opencode.ai/docs/commands",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "object",
              "properties": {
                "template": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "agent": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "subtask": {
                  "type": "boolean"
                }
              },
              "required": [
                "template"
              ]
            }
          },
          "skills": {
            "description": "Additional skill folder paths",
            "type": "object",
            "properties": {
              "paths": {
                "description": "Additional paths to skill folders",
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "urls": {
                "description": "URLs to fetch skills from (e.g., https://example.com/.well-known/skills/)",
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "watcher": {
            "type": "object",
            "properties": {
              "ignore": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "snapshot": {
            "description": "Enable or disable snapshot tracking. When false, filesystem snapshots are not recorded and undoing or reverting will not undo/redo file changes. Defaults to true.",
            "type": "boolean"
          },
          "plugin": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {}
                    }
                  ]
                }
              ]
            }
          },
          "share": {
            "description": "Control sharing behavior:'manual' allows manual sharing via commands, 'auto' enables automatic sharing, 'disabled' disables all sharing",
            "type": "string",
            "enum": [
              "manual",
              "auto",
              "disabled"
            ]
          },
          "autoshare": {
            "description": "@deprecated Use 'share' field instead. Share newly created sessions automatically",
            "type": "boolean"
          },
          "autoupdate": {
            "description": "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications",
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "string",
                "const": "notify"
              }
            ]
          },
          "disabled_providers": {
            "description": "Disable providers that are loaded automatically",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "enabled_providers": {
            "description": "When set, ONLY these providers will be enabled. All other providers will be ignored",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "model": {
            "description": "Model to use in the format of provider/model, eg anthropic/claude-2",
            "type": "string"
          },
          "small_model": {
            "description": "Small model to use for tasks like title generation in the format of provider/model",
            "type": "string"
          },
          "model_groups": {
            "description": "Named model groups (capability tiers, e.g. ultra/standard/lite). Each group has a default model and optional member models. A group name can be used anywhere a provider/model string is accepted.",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "object",
                  "properties": {
                    "default": {
                      "type": "string"
                    },
                    "models": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "default"
                  ]
                }
              ]
            }
          },
          "default_agent": {
            "description": "Default agent to use when none is specified. Must be a primary agent. Falls back to 'build' if not set or if the specified agent is invalid.",
            "type": "string"
          },
          "username": {
            "description": "Custom username to display in conversations instead of system username",
            "type": "string"
          },
          "mode": {
            "description": "@deprecated Use `agent` field instead.",
            "type": "object",
            "properties": {
              "build": {
                "$ref": "#/components/schemas/AgentConfig"
              },
              "plan": {
                "$ref": "#/components/schemas/AgentConfig"
              }
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/AgentConfig"
            }
          },
          "agent": {
            "description": "Agent configuration, see https://opencode.ai/docs/agents",
            "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": {
            "description": "Custom provider configurations and model overrides",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/ProviderConfig"
            }
          },
          "mcp": {
            "description": "MCP (Model Context Protocol) server configurations",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "anyOf": [
                {
                  "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",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "object",
                  "properties": {
                    "disabled": {
                      "type": "boolean"
                    },
                    "command": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "environment": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "type": "string"
                      }
                    },
                    "extensions": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            ]
          },
          "lsp": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "disabled": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "disabled"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "command": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "extensions": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "disabled": {
                          "type": "boolean"
                        },
                        "env": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {
                            "type": "string"
                          }
                        },
                        "initialization": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        }
                      },
                      "required": [
                        "command"
                      ]
                    }
                  ]
                }
              }
            ]
          },
          "instructions": {
            "description": "Additional instruction files or patterns to include",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "layout": {
            "$ref": "#/components/schemas/LayoutConfig"
          },
          "permission": {
            "$ref": "#/components/schemas/PermissionConfig"
          },
          "tools": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "boolean"
            }
          },
          "tool": {
            "description": "Tool invocation style configuration (JSON vs shell-style).",
            "type": "object",
            "properties": {
              "invocation_style": {
                "description": "Default invocation style for all tools. 'json' (default) exposes the original Zod schema; 'shell' exposes a single `script` parameter and uses the tool's shell.parse mapping.",
                "type": "string",
                "enum": [
                  "json",
                  "shell"
                ]
              },
              "invocation_style_by_tool": {
                "description": "Per-tool override of invocation_style. Keys are tool IDs. A tool without a `shell` field falls back to JSON regardless of this setting.",
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "string",
                  "enum": [
                    "json",
                    "shell"
                  ]
                }
              }
            }
          },
          "enterprise": {
            "type": "object",
            "properties": {
              "url": {
                "description": "Enterprise URL",
                "type": "string"
              }
            }
          },
          "compaction": {
            "type": "object",
            "properties": {
              "auto": {
                "description": "Enable automatic compaction when context is full (default: true)",
                "type": "boolean"
              },
              "prune": {
                "description": "Enable pruning of old tool outputs (default: true)",
                "type": "boolean"
              },
              "tail_turns": {
                "description": "Number of recent user turns, including their following assistant/tool responses, to keep verbatim during compaction (default: 2)",
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "preserve_recent_tokens": {
                "description": "Maximum number of tokens from recent turns to preserve verbatim after compaction",
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "reserved": {
                "description": "Token buffer for compaction. Leaves enough window to avoid overflow during compaction.",
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            }
          },
          "checkpoint": {
            "type": "object",
            "properties": {
              "thresholds": {
                "description": "Context fill thresholds that trigger checkpoint writes. Strings may be percentages (\"40%\"), absolute tokens (\"100K\", \"1.5M\"), or mixed (\"100K\", \"50%\"). Each threshold must be <= window - 20K reserved. Default: [\"40%\", \"60%\", \"80%\"].",
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "reserved": {
                "description": "Token buffer reserved for checkpoint operations. Default: 20000.",
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "push_caps": {
                "description": "Per-section token caps for rebuild context (renderRebuildContext). Each section is loaded up to its cap so the rebuild stays within a predictable budget.",
                "type": "object",
                "properties": {
                  "tasks_ledger": {
                    "description": "Token cap for the tasks ledger section of rebuild context. Default: 2000.",
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "focus_task": {
                    "description": "Token cap for the focus task body in rebuild context. Default: 4000.",
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "actor_ledger": {
                    "description": "Token cap for the actor ledger section of rebuild context. Default: 500.",
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "memory_titles": {
                    "description": "Token cap for memory titles in rebuild context. Default: 500.",
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "global": {
                    "description": "Token cap for the global memory section (global/MEMORY.md) of rebuild context. Default: 6000.",
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "checkpoint": {
                    "description": "Token cap for the session checkpoint section (checkpoint.md) of rebuild context. Default: 11000.",
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "memory": {
                    "description": "Token cap for the project memory section (MEMORY.md) of rebuild context. Default: 10000.",
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "notes": {
                    "description": "Token cap for the session notes (notes.md) of rebuild context. Default: 6000.",
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "design_decisions": {
                    "description": "Token cap for §10 Design decisions section of checkpoint.md (writer-side budget validation). Default: 3000.",
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "open_notes": {
                    "description": "Token cap for §11 Open notes section of checkpoint.md (writer-side budget validation). Default: 800.",
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  }
                }
              },
              "task_archive_days": {
                "description": "Number of days after task done/abandoned before it's filtered out of `list({include_archived: false})`. Rows are NOT deleted — see v9 for true GC. Default: 7.",
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              "task_cleanup_days": {
                "description": "[deprecated] Alias for task_archive_days. Will be removed in v9.",
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              "memory_reconcile_on_search": {
                "description": "Whether to reconcile memory state on search operations. Default: true.",
                "type": "boolean"
              }
            }
          },
          "experimental": {
            "type": "object",
            "properties": {
              "disable_paste_summary": {
                "type": "boolean"
              },
              "batch_tool": {
                "description": "Enable the batch tool",
                "type": "boolean"
              },
              "openTelemetry": {
                "description": "Enable OpenTelemetry spans for AI SDK calls (using the 'experimental_telemetry' flag)",
                "type": "boolean"
              },
              "primary_tools": {
                "description": "Tools that should only be available to primary agents.",
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "continue_loop_on_deny": {
                "description": "Continue the agent loop when a tool call is denied",
                "type": "boolean"
              },
              "mcp_timeout": {
                "description": "Timeout in milliseconds for model context protocol (MCP) requests",
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              "predict_next_prompt": {
                "description": "Predict the user's likely next prompt after each turn and show it as inline ghost text (Tab to accept). Enabled by default; set to false to disable.",
                "type": "boolean"
              },
              "maxMode": {
                "description": "Max mode (experimental): the 'max' agent runs N parallel reasoning candidates each step, picks the best via a judge call, and executes only the winner.",
                "type": "object",
                "properties": {
                  "candidates": {
                    "description": "Number of parallel reasoning candidates per step in max mode (default 5).",
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  }
                }
              }
            }
          },
          "workflow": {
            "description": "Dynamic workflow runtime settings.",
            "type": "object",
            "properties": {
              "maxConcurrentAgents": {
                "description": "Max subagents running concurrently in one workflow run. Default min(16, 2x CPU cores). Hard-capped at 2x cores.",
                "type": "number"
              },
              "scriptDeadlineMs": {
                "description": "Wall-clock budget for a whole workflow script, in milliseconds. Default 12h. The sandbox interrupt handler enforces this as a hard kill-switch.",
                "type": "number"
              }
            }
          }
        },
        "additionalProperties": false
      },
      "BadRequestError": {
        "type": "object",
        "properties": {
          "data": {},
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {}
            }
          },
          "success": {
            "type": "boolean",
            "const": false
          }
        },
        "required": [
          "data",
          "errors",
          "success"
        ]
      },
      "OAuth": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "oauth"
          },
          "refresh": {
            "type": "string"
          },
          "access": {
            "type": "string"
          },
          "expires": {
            "type": "number"
          },
          "accountId": {
            "type": "string"
          },
          "enterpriseUrl": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "refresh",
          "access",
          "expires"
        ]
      },
      "ApiAuth": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "api"
          },
          "key": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "required": [
          "type",
          "key"
        ]
      },
      "WellKnownAuth": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "wellknown"
          },
          "key": {
            "type": "string"
          },
          "token": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "key",
          "token"
        ]
      },
      "Auth": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/OAuth"
          },
          {
            "$ref": "#/components/schemas/ApiAuth"
          },
          {
            "$ref": "#/components/schemas/WellKnownAuth"
          }
        ]
      },
      "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"
          }
        },
        "required": [
          "id",
          "type",
          "name",
          "branch",
          "directory",
          "extra",
          "projectID"
        ]
      },
      "NotFoundError": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "const": "NotFoundError"
          },
          "data": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              }
            },
            "required": [
              "message"
            ]
          }
        },
        "required": [
          "name",
          "data"
        ]
      },
      "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"
            ]
          },
          "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"
                ]
              },
              "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"
                ]
              },
              "interleaved": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "field": {
                        "type": "string",
                        "enum": [
                          "reasoning_content",
                          "reasoning_details"
                        ]
                      }
                    },
                    "required": [
                      "field"
                    ]
                  }
                ]
              }
            },
            "required": [
              "temperature",
              "reasoning",
              "attachment",
              "toolcall",
              "input",
              "output",
              "interleaved"
            ]
          },
          "cost": {
            "type": "object",
            "properties": {
              "input": {
                "type": "number"
              },
              "output": {
                "type": "number"
              },
              "cache": {
                "type": "object",
                "properties": {
                  "read": {
                    "type": "number"
                  },
                  "write": {
                    "type": "number"
                  }
                },
                "required": [
                  "read",
                  "write"
                ]
              },
              "experimentalOver200K": {
                "type": "object",
                "properties": {
                  "input": {
                    "type": "number"
                  },
                  "output": {
                    "type": "number"
                  },
                  "cache": {
                    "type": "object",
                    "properties": {
                      "read": {
                        "type": "number"
                      },
                      "write": {
                        "type": "number"
                      }
                    },
                    "required": [
                      "read",
                      "write"
                    ]
                  }
                },
                "required": [
                  "input",
                  "output",
                  "cache"
                ]
              }
            },
            "required": [
              "input",
              "output",
              "cache"
            ]
          },
          "limit": {
            "type": "object",
            "properties": {
              "context": {
                "type": "number"
              },
              "input": {
                "type": "number"
              },
              "output": {
                "type": "number"
              }
            },
            "required": [
              "context",
              "output"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "alpha",
              "beta",
              "deprecated",
              "active"
            ]
          },
          "options": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "headers": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "release_date": {
            "type": "string"
          },
          "variants": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {}
            }
          },
          "cacheTTL": {
            "type": "number"
          },
          "cachePromptTTL": {
            "type": "string",
            "enum": [
              "5m",
              "1h"
            ]
          }
        },
        "required": [
          "id",
          "providerID",
          "api",
          "name",
          "capabilities",
          "cost",
          "limit",
          "status",
          "options",
          "headers",
          "release_date"
        ]
      },
      "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",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "models": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/Model"
            }
          }
        },
        "required": [
          "id",
          "name",
          "source",
          "env",
          "options",
          "models"
        ]
      },
      "ConsoleState": {
        "type": "object",
        "properties": {
          "consoleManagedProviders": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "activeOrgName": {
            "type": "string"
          },
          "switchableOrgCount": {
            "type": "number"
          }
        },
        "required": [
          "consoleManagedProviders",
          "switchableOrgCount"
        ]
      },
      "ToolIDs": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "ToolListItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "parameters": {}
        },
        "required": [
          "id",
          "description",
          "parameters"
        ]
      },
      "ToolList": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/ToolListItem"
        }
      },
      "Worktree": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "branch": {
            "type": "string"
          },
          "directory": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "branch",
          "directory"
        ]
      },
      "WorktreeCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "startCommand": {
            "description": "Additional startup script to run after the project's start command",
            "type": "string"
          }
        }
      },
      "WorktreeRemoveInput": {
        "type": "object",
        "properties": {
          "directory": {
            "type": "string"
          }
        },
        "required": [
          "directory"
        ]
      },
      "WorktreeResetInput": {
        "type": "object",
        "properties": {
          "directory": {
            "type": "string"
          }
        },
        "required": [
          "directory"
        ]
      },
      "ProjectSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "worktree": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "worktree"
        ]
      },
      "GlobalSession": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^ses.*"
          },
          "slug": {
            "type": "string"
          },
          "projectID": {
            "type": "string"
          },
          "workspaceID": {
            "type": "string",
            "pattern": "^wrk.*"
          },
          "directory": {
            "type": "string"
          },
          "parentID": {
            "type": "string",
            "pattern": "^ses.*"
          },
          "contextFrom": {
            "type": "string",
            "pattern": "^ses.*"
          },
          "contextWatermark": {
            "type": "string",
            "pattern": "^msg.*"
          },
          "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"
            ]
          },
          "share": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string"
              }
            },
            "required": [
              "url"
            ]
          },
          "title": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "time": {
            "type": "object",
            "properties": {
              "created": {
                "type": "number"
              },
              "updated": {
                "type": "number"
              },
              "compacting": {
                "type": "number"
              },
              "archived": {
                "type": "number"
              }
            },
            "required": [
              "created",
              "updated"
            ]
          },
          "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"
            ]
          },
          "project": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ProjectSummary"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "slug",
          "projectID",
          "directory",
          "title",
          "version",
          "time",
          "project"
        ]
      },
      "McpResource": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "uri": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "mimeType": {
            "type": "string"
          },
          "client": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "uri",
          "client"
        ]
      },
      "ConflictError": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "const": "UnknownError"
          },
          "data": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              }
            },
            "required": [
              "message"
            ]
          }
        },
        "required": [
          "name",
          "data"
        ]
      },
      "TextPartInput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prt.*"
          },
          "type": {
            "type": "string",
            "const": "text"
          },
          "text": {
            "type": "string"
          },
          "synthetic": {
            "type": "boolean"
          },
          "ignored": {
            "type": "boolean"
          },
          "time": {
            "type": "object",
            "properties": {
              "start": {
                "type": "number"
              },
              "end": {
                "type": "number"
              }
            },
            "required": [
              "start"
            ]
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "required": [
          "type",
          "text"
        ]
      },
      "FilePartInput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prt.*"
          },
          "type": {
            "type": "string",
            "const": "file"
          },
          "mime": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "source": {
            "$ref": "#/components/schemas/FilePartSource"
          }
        },
        "required": [
          "type",
          "mime",
          "url"
        ]
      },
      "AgentPartInput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prt.*"
          },
          "type": {
            "type": "string",
            "const": "agent"
          },
          "name": {
            "type": "string"
          },
          "source": {
            "type": "object",
            "properties": {
              "value": {
                "type": "string"
              },
              "start": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "end": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "value",
              "start",
              "end"
            ]
          }
        },
        "required": [
          "type",
          "name"
        ]
      },
      "SubtaskPartInput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prt.*"
          },
          "type": {
            "type": "string",
            "const": "subtask"
          },
          "prompt": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "agent": {
            "type": "string"
          },
          "model": {
            "type": "object",
            "properties": {
              "providerID": {
                "type": "string"
              },
              "modelID": {
                "type": "string"
              }
            },
            "required": [
              "providerID",
              "modelID"
            ]
          },
          "command": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "prompt",
          "description",
          "agent"
        ]
      },
      "ProviderAuthMethod": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "oauth",
              "api"
            ]
          },
          "label": {
            "type": "string"
          },
          "prompts": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "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"
                      ]
                    }
                  },
                  "required": [
                    "type",
                    "key",
                    "message"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "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"
                        ]
                      }
                    },
                    "when": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "op": {
                          "type": "string",
                          "enum": [
                            "eq",
                            "neq"
                          ]
                        },
                        "value": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "key",
                        "op",
                        "value"
                      ]
                    }
                  },
                  "required": [
                    "type",
                    "key",
                    "message",
                    "options"
                  ]
                }
              ]
            }
          }
        },
        "required": [
          "type",
          "label"
        ]
      },
      "ProviderAuthAuthorization": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "method": {
            "type": "string",
            "enum": [
              "auto",
              "code"
            ]
          },
          "instructions": {
            "type": "string"
          }
        },
        "required": [
          "url",
          "method",
          "instructions"
        ]
      },
      "Symbol": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "number"
          },
          "location": {
            "type": "object",
            "properties": {
              "uri": {
                "type": "string"
              },
              "range": {
                "$ref": "#/components/schemas/Range"
              }
            },
            "required": [
              "uri",
              "range"
            ]
          }
        },
        "required": [
          "name",
          "kind",
          "location"
        ]
      },
      "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"
        ]
      },
      "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": "number"
                    },
                    "oldLines": {
                      "type": "number"
                    },
                    "newStart": {
                      "type": "number"
                    },
                    "newLines": {
                      "type": "number"
                    },
                    "lines": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "oldStart",
                    "oldLines",
                    "newStart",
                    "newLines",
                    "lines"
                  ]
                }
              },
              "index": {
                "type": "string"
              }
            },
            "required": [
              "oldFileName",
              "newFileName",
              "hunks"
            ]
          },
          "encoding": {
            "type": "string",
            "const": "base64"
          },
          "mimeType": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "content"
        ]
      },
      "File": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string"
          },
          "added": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "removed": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "status": {
            "type": "string",
            "enum": [
              "added",
              "deleted",
              "modified"
            ]
          }
        },
        "required": [
          "path",
          "added",
          "removed",
          "status"
        ]
      },
      "Event": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/Event.project.updated"
          },
          {
            "$ref": "#/components/schemas/Event.server.instance.disposed"
          },
          {
            "$ref": "#/components/schemas/Event.server.connected"
          },
          {
            "$ref": "#/components/schemas/Event.global.disposed"
          },
          {
            "$ref": "#/components/schemas/Event.file.edited"
          },
          {
            "$ref": "#/components/schemas/Event.file.watcher.updated"
          },
          {
            "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
          },
          {
            "$ref": "#/components/schemas/Event.lsp.updated"
          },
          {
            "$ref": "#/components/schemas/Event.installation.updated"
          },
          {
            "$ref": "#/components/schemas/Event.installation.update-available"
          },
          {
            "$ref": "#/components/schemas/Event.message.part.delta"
          },
          {
            "$ref": "#/components/schemas/Event.permission.asked"
          },
          {
            "$ref": "#/components/schemas/Event.permission.replied"
          },
          {
            "$ref": "#/components/schemas/Event.actor.registered"
          },
          {
            "$ref": "#/components/schemas/Event.actor.status"
          },
          {
            "$ref": "#/components/schemas/Event.actor.stuck"
          },
          {
            "$ref": "#/components/schemas/Event.writer.cache_perf"
          },
          {
            "$ref": "#/components/schemas/Event.inbox.arrived"
          },
          {
            "$ref": "#/components/schemas/Event.session.diff"
          },
          {
            "$ref": "#/components/schemas/Event.session.error"
          },
          {
            "$ref": "#/components/schemas/Event.session.retry.attempt"
          },
          {
            "$ref": "#/components/schemas/Event.hook.executed"
          },
          {
            "$ref": "#/components/schemas/Event.hook.react.reentered"
          },
          {
            "$ref": "#/components/schemas/Event.hook.react.max_reached"
          },
          {
            "$ref": "#/components/schemas/Event.question.asked"
          },
          {
            "$ref": "#/components/schemas/Event.question.replied"
          },
          {
            "$ref": "#/components/schemas/Event.question.rejected"
          },
          {
            "$ref": "#/components/schemas/Event.session.cwd"
          },
          {
            "$ref": "#/components/schemas/Event.bash.interactive.asked"
          },
          {
            "$ref": "#/components/schemas/Event.bash.interactive.replied"
          },
          {
            "$ref": "#/components/schemas/Event.team.created"
          },
          {
            "$ref": "#/components/schemas/Event.team.member.joined"
          },
          {
            "$ref": "#/components/schemas/Event.task.created"
          },
          {
            "$ref": "#/components/schemas/Event.task.updated"
          },
          {
            "$ref": "#/components/schemas/Event.todo.updated"
          },
          {
            "$ref": "#/components/schemas/Event.session.status"
          },
          {
            "$ref": "#/components/schemas/Event.session.idle"
          },
          {
            "$ref": "#/components/schemas/Event.session.goal"
          },
          {
            "$ref": "#/components/schemas/Event.metrics.model_call"
          },
          {
            "$ref": "#/components/schemas/Event.metrics.tool_call"
          },
          {
            "$ref": "#/components/schemas/Event.metrics.agent_request"
          },
          {
            "$ref": "#/components/schemas/Event.session.compacted"
          },
          {
            "$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/Event.tui.instructions.loaded"
          },
          {
            "$ref": "#/components/schemas/Event.mcp.tools.changed"
          },
          {
            "$ref": "#/components/schemas/Event.mcp.browser.open.failed"
          },
          {
            "$ref": "#/components/schemas/Event.command.executed"
          },
          {
            "$ref": "#/components/schemas/Event.vcs.branch.updated"
          },
          {
            "$ref": "#/components/schemas/Event.worktree.ready"
          },
          {
            "$ref": "#/components/schemas/Event.worktree.failed"
          },
          {
            "$ref": "#/components/schemas/Event.pty.created"
          },
          {
            "$ref": "#/components/schemas/Event.pty.updated"
          },
          {
            "$ref": "#/components/schemas/Event.pty.exited"
          },
          {
            "$ref": "#/components/schemas/Event.pty.deleted"
          },
          {
            "$ref": "#/components/schemas/Event.workflow.phase"
          },
          {
            "$ref": "#/components/schemas/Event.workflow.log"
          },
          {
            "$ref": "#/components/schemas/Event.workflow.started"
          },
          {
            "$ref": "#/components/schemas/Event.workflow.finished"
          },
          {
            "$ref": "#/components/schemas/Event.workspace.ready"
          },
          {
            "$ref": "#/components/schemas/Event.workspace.failed"
          },
          {
            "$ref": "#/components/schemas/Event.workspace.restore"
          },
          {
            "$ref": "#/components/schemas/Event.workspace.status"
          },
          {
            "$ref": "#/components/schemas/Event.message.updated"
          },
          {
            "$ref": "#/components/schemas/Event.message.removed"
          },
          {
            "$ref": "#/components/schemas/Event.message.part.updated"
          },
          {
            "$ref": "#/components/schemas/Event.message.part.removed"
          },
          {
            "$ref": "#/components/schemas/Event.session.created"
          },
          {
            "$ref": "#/components/schemas/Event.session.updated"
          },
          {
            "$ref": "#/components/schemas/Event.session.deleted"
          }
        ]
      },
      "MCPStatusConnected": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "const": "connected"
          }
        },
        "required": [
          "status"
        ]
      },
      "MCPStatusDisabled": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "const": "disabled"
          }
        },
        "required": [
          "status"
        ]
      },
      "MCPStatusPending": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "const": "pending"
          }
        },
        "required": [
          "status"
        ]
      },
      "MCPStatusFailed": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "const": "failed"
          },
          "error": {
            "type": "string"
          }
        },
        "required": [
          "status",
          "error"
        ]
      },
      "MCPStatusNeedsAuth": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "const": "needs_auth"
          }
        },
        "required": [
          "status"
        ]
      },
      "MCPStatusNeedsClientRegistration": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "const": "needs_client_registration"
          },
          "error": {
            "type": "string"
          }
        },
        "required": [
          "status",
          "error"
        ]
      },
      "MCPStatus": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/MCPStatusConnected"
          },
          {
            "$ref": "#/components/schemas/MCPStatusDisabled"
          },
          {
            "$ref": "#/components/schemas/MCPStatusPending"
          },
          {
            "$ref": "#/components/schemas/MCPStatusFailed"
          },
          {
            "$ref": "#/components/schemas/MCPStatusNeedsAuth"
          },
          {
            "$ref": "#/components/schemas/MCPStatusNeedsClientRegistration"
          }
        ]
      },
      "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"
        ]
      },
      "VcsInfo": {
        "type": "object",
        "properties": {
          "branch": {
            "type": "string"
          },
          "default_branch": {
            "type": "string"
          }
        }
      },
      "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",
          "patch",
          "additions",
          "deletions"
        ]
      },
      "Command": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "agent": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "enum": [
              "command",
              "mcp",
              "skill"
            ]
          },
          "template": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "string"
              }
            ]
          },
          "subtask": {
            "type": "boolean"
          },
          "hints": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "name",
          "template",
          "hints"
        ]
      },
      "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"
            ]
          },
          "modelRef": {
            "type": "string"
          },
          "variant": {
            "type": "string"
          },
          "prompt": {
            "type": "string"
          },
          "options": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "steps": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "toolAllowlist": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "name",
          "mode",
          "permission",
          "options"
        ]
      },
      "LSPStatus": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "root": {
            "type": "string"
          },
          "status": {
            "anyOf": [
              {
                "type": "string",
                "const": "connected"
              },
              {
                "type": "string",
                "const": "error"
              }
            ]
          }
        },
        "required": [
          "id",
          "name",
          "root",
          "status"
        ]
      },
      "FormatterStatus": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "extensions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "extensions",
          "enabled"
        ]
      }
    }
  }
}