{
  "openapi": "3.1.0",
  "info": {
    "title": "Flocks Agent Integration API",
    "version": "fa86a422",
    "description": "56项共享程序集成接口。按业务用途筛选，不是全量Web后台，也不是稳定性承诺。"
  },
  "paths": {
    "/api/session/status": {
      "get": {
        "tags": [
          "Session"
        ],
        "summary": "Get session status",
        "description": "Retrieve the current status of all sessions (idle, busy, retry)",
        "operationId": "integration_678967e43cb2",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Get Session Status Api Session Status Get"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:869"
      }
    },
    "/api/session/{sessionID}/status": {
      "get": {
        "tags": [
          "Session"
        ],
        "summary": "Get session runtime status",
        "description": "Get the current runtime status of a specific session",
        "operationId": "integration_af1b439ebb75",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionRuntimeStatusResponse"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:970"
      }
    },
    "/api/session/{sessionID}/turn/{turnID}": {
      "get": {
        "tags": [
          "Session"
        ],
        "summary": "Get how a turn stands",
        "description": "The receipt of a prompt or command sent with turnID: accepted, queued, running, done, failed, removed, or lost",
        "operationId": "integration_a0ff93aece9b",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          },
          {
            "name": "turnID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Turnid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Session.Turnbyid"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:995"
      }
    },
    "/api/session": {
      "get": {
        "tags": [
          "Session"
        ],
        "summary": "List sessions",
        "description": "Get a list of all sessions, sorted by most recently updated",
        "operationId": "integration_fa1f50c84648",
        "parameters": [
          {
            "name": "view",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "const": "list",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Use lightweight list rows",
              "title": "View"
            },
            "description": "Use lightweight list rows"
          },
          {
            "name": "manager",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Apply session-manager visibility filters",
              "title": "Manager"
            },
            "description": "Apply session-manager visibility filters"
          },
          {
            "name": "directory",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by project directory",
              "title": "Directory"
            },
            "description": "Filter by project directory"
          },
          {
            "name": "projectID",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by effective project ID",
              "title": "Projectid"
            },
            "description": "Filter by effective project ID"
          },
          {
            "name": "roots",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only return root sessions (no parentID)",
              "title": "Roots"
            },
            "description": "Only return root sessions (no parentID)"
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter sessions updated on or after this timestamp",
              "title": "Start"
            },
            "description": "Filter sessions updated on or after this timestamp"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by title (case-insensitive)",
              "title": "Search"
            },
            "description": "Filter by title (case-insensitive)"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum sessions to return",
              "title": "Limit"
            },
            "description": "Maximum sessions to return"
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Number of filtered sessions to skip",
              "title": "Offset"
            },
            "description": "Number of filtered sessions to skip"
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by category: user or task",
              "title": "Category"
            },
            "description": "Filter by category: user or task"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "active",
                "archived",
                "all"
              ],
              "type": "string",
              "description": "Filter by session status",
              "default": "active",
              "title": "Status"
            },
            "description": "Filter by session status"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/SessionResponse"
                      },
                      {
                        "$ref": "#/components/schemas/SessionListItem"
                      }
                    ]
                  },
                  "title": "Response List Sessions Api Session Get"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:1074"
      },
      "post": {
        "tags": [
          "Session"
        ],
        "summary": "Create session",
        "description": "Create a new session",
        "operationId": "integration_56eb7b0afb99",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/SessionCreateRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionResponse"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:1338"
      }
    },
    "/api/session/{sessionID}": {
      "get": {
        "tags": [
          "Session"
        ],
        "summary": "Get session",
        "description": "Get session by ID",
        "operationId": "integration_2fd82164fdca",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionDetailResponse"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:1703"
      },
      "delete": {
        "tags": [
          "Session"
        ],
        "summary": "Permanently delete session",
        "description": "Permanently delete a session tree and its persisted history",
        "operationId": "integration_3fd8cc6afd19",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "title": "Response Delete Session Api Session  Sessionid  Delete"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:2313"
      },
      "patch": {
        "tags": [
          "Session"
        ],
        "summary": "Update session",
        "description": "Update session properties",
        "operationId": "integration_03171410b4d2",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionResponse"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:2391"
      }
    },
    "/api/session/{sessionID}/children": {
      "get": {
        "tags": [
          "Session"
        ],
        "summary": "Get session children",
        "description": "Get all child sessions forked from the specified parent",
        "operationId": "integration_268bccca4da0",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SessionResponse"
                  },
                  "title": "Response Get Session Children Api Session  Sessionid  Children Get"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:1792"
      }
    },
    "/api/session/{sessionID}/todo": {
      "get": {
        "tags": [
          "Session"
        ],
        "summary": "Get session todos",
        "description": "Get the todo list for a session",
        "operationId": "integration_fea4f036c51b",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TodoInfo"
                  },
                  "title": "Response Get Session Todos Api Session  Sessionid  Todo Get"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:1825"
      },
      "post": {
        "tags": [
          "Session"
        ],
        "summary": "Update session todos",
        "description": "Update the todo list for a session",
        "operationId": "integration_e1fd7dd4f065",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/TodoInfo"
                },
                "title": "Todos"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TodoInfo"
                  },
                  "title": "Response Update Session Todos Api Session  Sessionid  Todo Post"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:1850"
      }
    },
    "/api/session/{sessionID}/context": {
      "get": {
        "tags": [
          "Session"
        ],
        "summary": "Get Session Context",
        "operationId": "integration_ec7072f61702",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Before"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:1910"
      }
    },
    "/api/session/{sessionID}/context/files/{resourceID}/metadata": {
      "get": {
        "tags": [
          "Session"
        ],
        "summary": "Get Session Context file metadata",
        "operationId": "integration_e83c4a7234f4",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          },
          {
            "name": "resourceID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Resourceid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:1948"
      }
    },
    "/api/session/{sessionID}/context/files/{resourceID}/content": {
      "get": {
        "tags": [
          "Session"
        ],
        "summary": "Read Session Context text file",
        "operationId": "integration_de6fd5058865",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          },
          {
            "name": "resourceID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Resourceid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:1956"
      }
    },
    "/api/session/{sessionID}/context/files/{resourceID}/download": {
      "get": {
        "tags": [
          "Session"
        ],
        "summary": "Download Session Context file",
        "operationId": "integration_c99a43961cc0",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          },
          {
            "name": "resourceID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Resourceid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:1987"
      }
    },
    "/api/session/{sessionID}/context/folders": {
      "post": {
        "tags": [
          "Session"
        ],
        "summary": "Add Session Context folder",
        "operationId": "integration_2a9e984e55ba",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContextFolderCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:1995"
      }
    },
    "/api/session/{sessionID}/context/folders/{rootID}": {
      "delete": {
        "tags": [
          "Session"
        ],
        "summary": "Remove Session Context folder",
        "operationId": "integration_678b2812303b",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          },
          {
            "name": "rootID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Rootid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:2050"
      }
    },
    "/api/session/{sessionID}/context/roots/{rootID}/list": {
      "get": {
        "tags": [
          "Session"
        ],
        "summary": "List Session Context folder",
        "operationId": "integration_a35aacda0871",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          },
          {
            "name": "rootID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Rootid"
            }
          },
          {
            "name": "path",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "",
              "title": "Path"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:2103"
      }
    },
    "/api/session/{sessionID}/context/roots/{rootID}/content": {
      "get": {
        "tags": [
          "Session"
        ],
        "summary": "Read Session Context folder text file",
        "operationId": "integration_5eb46480129b",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          },
          {
            "name": "rootID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Rootid"
            }
          },
          {
            "name": "path",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Path"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:2129"
      }
    },
    "/api/session/{sessionID}/context/roots/{rootID}/download": {
      "get": {
        "tags": [
          "Session"
        ],
        "summary": "Download Session Context folder file",
        "operationId": "integration_4245af6340fc",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          },
          {
            "name": "rootID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Rootid"
            }
          },
          {
            "name": "path",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Path"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:2168"
      }
    },
    "/api/session/{sessionID}/archive": {
      "post": {
        "tags": [
          "Session"
        ],
        "summary": "Archive session",
        "description": "Archive a session and its descendants without deleting persisted data",
        "operationId": "integration_30a9fe089a72",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionResponse"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:2183"
      }
    },
    "/api/session/{sessionID}/restore": {
      "post": {
        "tags": [
          "Session"
        ],
        "summary": "Restore session",
        "description": "Restore an archived session and its descendants",
        "operationId": "integration_645037319075",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionResponse"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:2194"
      }
    },
    "/api/session/{sessionID}/abort": {
      "post": {
        "tags": [
          "Session"
        ],
        "summary": "Abort session",
        "description": "Abort an active session and stop any ongoing processing",
        "operationId": "integration_efe0c555b6ef",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AbortSessionResult"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:2749"
      }
    },
    "/api/session/{sessionID}/init": {
      "post": {
        "tags": [
          "Session"
        ],
        "summary": "Initialize session",
        "description": "Analyze the current application and create an AGENTS.md file with project-specific agent configurations",
        "operationId": "integration_7976d148ce6b",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InitRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "title": "Response Initialize Session Api Session  Sessionid  Init Post"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:2812"
      }
    },
    "/api/session/{sessionID}/fork": {
      "post": {
        "tags": [
          "Session"
        ],
        "summary": "Fork session",
        "description": "Create a new session by forking at a specific message point",
        "operationId": "integration_41a947e368ee",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ForkRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionResponse"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:2865"
      }
    },
    "/api/session/{sessionID}/diff": {
      "get": {
        "tags": [
          "Session"
        ],
        "summary": "Get session diff",
        "description": "Get file diffs for a session or specific message",
        "operationId": "integration_c07c973aad90",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          },
          {
            "name": "messageID",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Message ID to get diff for",
              "title": "Messageid"
            },
            "description": "Message ID to get diff for"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FileDiff"
                  },
                  "title": "Response Get Session Diff Api Session  Sessionid  Diff Get"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:2906"
      }
    },
    "/api/session/{sessionID}/summarize": {
      "post": {
        "tags": [
          "Session"
        ],
        "summary": "Summarize session",
        "description": "Generate a summary using AI compaction",
        "operationId": "integration_5653b0b9cde2",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SummarizeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "title": "Response Summarize Session Api Session  Sessionid  Summarize Post"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:2950"
      }
    },
    "/api/session/{sessionID}/revert": {
      "post": {
        "tags": [
          "Session"
        ],
        "summary": "Revert session",
        "description": "Revert session to a specific message point",
        "operationId": "integration_4f08e8be1cd5",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RevertRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionResponse"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:3032"
      }
    },
    "/api/session/{sessionID}/unrevert": {
      "post": {
        "tags": [
          "Session"
        ],
        "summary": "Unrevert session",
        "description": "Restore previously reverted messages",
        "operationId": "integration_a81a94e4d774",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionResponse"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:3075"
      }
    },
    "/api/session/{sessionID}/message": {
      "get": {
        "tags": [
          "Session"
        ],
        "summary": "Get session messages",
        "description": "Get all messages in a session",
        "operationId": "integration_e9706257e57a",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 100,
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum messages to return",
              "title": "Limit"
            },
            "description": "Maximum messages to return"
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Load messages before this message id",
              "title": "Before"
            },
            "description": "Load messages before this message id"
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Load messages after this message id",
              "title": "After"
            },
            "description": "Load messages after this message id"
          },
          {
            "name": "around",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Load a page containing this message id",
              "title": "Around"
            },
            "description": "Load a page containing this message id"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Return paged response metadata",
              "default": false,
              "title": "Page"
            },
            "description": "Return paged response metadata"
          },
          {
            "name": "include_archived",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include compacted/archived messages",
              "default": true,
              "title": "Include Archived"
            },
            "description": "Include compacted/archived messages"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/MessageWithParts"
                      }
                    },
                    {
                      "$ref": "#/components/schemas/MessagePage"
                    }
                  ],
                  "title": "Response Get Session Messages Api Session  Sessionid  Message Get"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:3457"
      },
      "post": {
        "tags": [
          "Session"
        ],
        "summary": "Send message",
        "description": "Send a new message and get AI response",
        "operationId": "integration_d0d56bed4dbc",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PromptRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageWithParts"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:4380"
      }
    },
    "/api/session/{sessionID}/message/{messageID}": {
      "get": {
        "tags": [
          "Session"
        ],
        "summary": "Get message",
        "description": "Get a specific message by ID",
        "operationId": "integration_b5ce90f4ba10",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          },
          {
            "name": "messageID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Messageid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageWithParts"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:3555"
      }
    },
    "/api/session/{sessionID}/message/{messageID}/part/{partID}": {
      "delete": {
        "tags": [
          "Session"
        ],
        "summary": "Delete message part",
        "description": "Delete a specific part from a message",
        "operationId": "integration_b7eb204acc25",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          },
          {
            "name": "messageID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Messageid"
            }
          },
          {
            "name": "partID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Partid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "title": "Response Delete Message Part Api Session  Sessionid  Message  Messageid  Part  Partid  Delete"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:3589"
      },
      "patch": {
        "tags": [
          "Session"
        ],
        "summary": "Update message part",
        "description": "Update a specific part in a message",
        "operationId": "integration_7a39277c2899",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          },
          {
            "name": "messageID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Messageid"
            }
          },
          {
            "name": "partID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Partid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessagePartInfo"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessagePartInfo"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:3625"
      }
    },
    "/api/session/{sessionID}/message/{messageID}/resend": {
      "post": {
        "tags": [
          "Session"
        ],
        "summary": "Replay edited user message",
        "description": "Update a user message and regenerate subsequent assistant output",
        "operationId": "integration_0059eb56e75b",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          },
          {
            "name": "messageID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Messageid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageEditRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  },
                  "title": "Response Resend Session Message Api Session  Sessionid  Message  Messageid  Resend Post"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:4150"
      }
    },
    "/api/session/{sessionID}/message/{messageID}/regenerate": {
      "post": {
        "tags": [
          "Session"
        ],
        "summary": "Regenerate assistant message",
        "description": "Discard an assistant reply and regenerate it from its parent user message",
        "operationId": "integration_4a37e7b98fd8",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          },
          {
            "name": "messageID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Messageid"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  },
                  "title": "Response Regenerate Session Message Api Session  Sessionid  Message  Messageid  Regenerate Post"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:4263"
      }
    },
    "/api/session/{sessionID}/prompt_queue": {
      "get": {
        "tags": [
          "Session"
        ],
        "summary": "List queued prompts",
        "description": "List pending non-blocking prompts for a session",
        "operationId": "integration_006437b27061",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response List Prompt Queue Api Session  Sessionid  Prompt Queue Get"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:6134"
      },
      "post": {
        "tags": [
          "Session"
        ],
        "summary": "Queue prompt",
        "description": "Queue a prompt without writing it to the formal message history",
        "operationId": "integration_b5b2d3658766",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PromptRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Enqueue Prompt Api Session  Sessionid  Prompt Queue Post"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:6154"
      }
    },
    "/api/session/{sessionID}/prompt_queue/{queueID}": {
      "patch": {
        "tags": [
          "Session"
        ],
        "summary": "Update queued prompt",
        "description": "Update the text part of a queued prompt",
        "operationId": "integration_4b6f8a686bcd",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          },
          {
            "name": "queueID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Queueid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PromptQueueUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Update Prompt Queue Item Api Session  Sessionid  Prompt Queue  Queueid  Patch"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:6188"
      },
      "delete": {
        "tags": [
          "Session"
        ],
        "summary": "Remove queued prompt",
        "description": "Remove a queued prompt before it executes",
        "operationId": "integration_c3fc8359118a",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          },
          {
            "name": "queueID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Queueid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Remove Prompt Queue Item Api Session  Sessionid  Prompt Queue  Queueid  Delete"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:6220"
      }
    },
    "/api/session/{sessionID}/prompt_queue/{queueID}/run_now": {
      "post": {
        "tags": [
          "Session"
        ],
        "summary": "Run queued prompt now",
        "description": "Abort the current prompt and run the selected queued prompt next",
        "operationId": "integration_b12472caf8ea",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          },
          {
            "name": "queueID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Queueid"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Run Prompt Queue Item Now Api Session  Sessionid  Prompt Queue  Queueid  Run Now Post"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:6258"
      }
    },
    "/api/session/{sessionID}/prompt_async": {
      "post": {
        "tags": [
          "Session"
        ],
        "summary": "Send async message",
        "description": "Send a message asynchronously (returns immediately)",
        "operationId": "integration_2171d1efed3e",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PromptRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:6296"
      }
    },
    "/api/session/{sessionID}/command": {
      "post": {
        "tags": [
          "Session"
        ],
        "summary": "Send command",
        "description": "Execute a slash command in the session (returns 202, result via SSE)",
        "operationId": "integration_76f392b2c673",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommandRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:6469"
      }
    },
    "/api/session/{sessionID}/shell": {
      "post": {
        "tags": [
          "Session"
        ],
        "summary": "Run shell command",
        "description": "Execute a shell command in the session context",
        "operationId": "integration_c9ac17bc932a",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShellRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:6686"
      }
    },
    "/api/session/{sessionID}/clear": {
      "post": {
        "tags": [
          "Session"
        ],
        "summary": "Clear Session",
        "description": "Clear session messages\n\nRemoves all messages from the session while keeping the session itself.",
        "operationId": "integration_8133c7106851",
        "parameters": [
          {
            "name": "sessionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sessionid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/session.py:6855"
      }
    },
    "/api/model/": {
      "get": {
        "tags": [
          "Model"
        ],
        "summary": "List all models",
        "description": "List all available models across all providers",
        "operationId": "integration_eb42138c0e09",
        "parameters": [
          {
            "name": "provider",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by provider ID",
              "title": "Provider"
            },
            "description": "Filter by provider ID"
          },
          {
            "name": "streaming",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by streaming support",
              "title": "Streaming"
            },
            "description": "Filter by streaming support"
          },
          {
            "name": "tools",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by tool support",
              "title": "Tools"
            },
            "description": "Filter by tool support"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelListResponse"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/model.py:144"
      }
    },
    "/api/model/{model_id}": {
      "get": {
        "tags": [
          "Model"
        ],
        "summary": "Get model details",
        "description": "Get detailed information about a specific model",
        "operationId": "integration_de23bd6a2991",
        "parameters": [
          {
            "name": "model_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Model Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelDetail"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/model.py:615"
      }
    },
    "/api/agent": {
      "get": {
        "tags": [
          "Agent"
        ],
        "summary": "List agents",
        "description": "List all available agents with model overrides applied.",
        "operationId": "integration_2f3ab874cff1",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AgentResponse"
                  },
                  "type": "array",
                  "title": "Response List Agents Api Agent Get"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/agent.py:389"
      }
    },
    "/api/agent/{name}": {
      "get": {
        "tags": [
          "Agent"
        ],
        "summary": "Get agent",
        "description": "Get a specific agent by name with model override applied.",
        "operationId": "integration_6a25ebe05a97",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Name"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentResponse"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/agent.py:408"
      }
    },
    "/api/event": {
      "get": {
        "tags": [
          "Event"
        ],
        "summary": "Subscribe to events",
        "description": "Subscribe to server-sent events (SSE) stream",
        "operationId": "integration_3fd544b3d6a8",
        "responses": {
          "200": {
            "description": "直接 Event 对象的 SSE 流",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/event.py:648"
      }
    },
    "/api/question/session/{session_id}/pending": {
      "get": {
        "tags": [
          "Question"
        ],
        "summary": "List pending questions for a session",
        "description": "Return all unanswered Question requests for the given session",
        "operationId": "integration_3dfebd761ce0",
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Session Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "title": "Response Get Pending Question Requests Api Question Session  Session Id  Pending Get"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/question.py:143"
      }
    },
    "/api/question/{request_id}/reply": {
      "post": {
        "tags": [
          "Question"
        ],
        "summary": "Reply to question request",
        "description": "Reply to a QuestionRequest with answers for all questions",
        "operationId": "integration_17acbb171781",
        "parameters": [
          {
            "name": "request_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Request Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuestionRequestReply"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Reply Question Request Api Question  Request Id  Reply Post"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/question.py:156"
      }
    },
    "/api/question/{request_id}/reject": {
      "post": {
        "tags": [
          "Question"
        ],
        "summary": "Reject question request",
        "description": "Reject a QuestionRequest (user doesn't want to answer)",
        "operationId": "integration_b40b98c661fd",
        "parameters": [
          {
            "name": "request_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Request Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "boolean"
                  },
                  "title": "Response Reject Question Request Api Question  Request Id  Reject Post"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/question.py:195"
      }
    },
    "/api/permission": {
      "get": {
        "tags": [
          "Permission"
        ],
        "summary": "List permissions",
        "description": "Get all pending permission requests",
        "operationId": "integration_e3a940dde6b8",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PermissionInfo"
                  },
                  "type": "array",
                  "title": "Response List Permissions Api Permission Get"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/permission.py:193"
      }
    },
    "/api/permission/{permission_id}": {
      "get": {
        "tags": [
          "Permission"
        ],
        "summary": "Get permission",
        "description": "Get a specific permission request",
        "operationId": "integration_e1c59e620b08",
        "parameters": [
          {
            "name": "permission_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Permission Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PermissionInfo"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/permission.py:281"
      }
    },
    "/api/permission/{permission_id}/reply": {
      "post": {
        "tags": [
          "Permission"
        ],
        "summary": "Reply to permission",
        "description": "Reply to a permission request (allow or deny)",
        "operationId": "integration_bab21f2cd4ed",
        "parameters": [
          {
            "name": "permission_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Permission Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PermissionReplyRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "boolean"
                  },
                  "title": "Response Reply Permission Api Permission  Permission Id  Reply Post"
                }
              }
            }
          },
          "422": {
            "description": "核心服务输入校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-source": "flocks/server/routes/permission.py:309"
      }
    }
  },
  "components": {
    "schemas": {
      "HTTPValidationError": {
        "type": "object",
        "required": [
          "error",
          "message",
          "details"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "details": {
            "type": "array",
            "items": {}
          }
        },
        "description": "核心服务请求输入校验失败的响应；业务 HTTPException 的结构见总说明。"
      },
      "ModelDetail": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Model ID"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Human-readable name"
          },
          "provider": {
            "type": "string",
            "title": "Provider",
            "description": "Provider ID"
          },
          "max_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Tokens",
            "description": "Maximum tokens"
          },
          "context_window": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context Window",
            "description": "Context window size"
          },
          "capabilities": {
            "$ref": "#/components/schemas/ModelCapabilities"
          },
          "pricing": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pricing",
            "description": "Pricing info"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object",
            "title": "Metadata",
            "description": "Additional metadata"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "provider"
        ],
        "title": "ModelDetail",
        "description": "Detailed model information"
      },
      "SessionCreateRequest": {
        "properties": {
          "parent_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parent Id",
            "description": "Parent session ID"
          },
          "project_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Project Id",
            "description": "Project ID"
          },
          "title": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Title",
            "description": "Session title"
          },
          "permission": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/PermissionRule"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Permission",
            "description": "Permission rules"
          },
          "category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Category",
            "description": "Session category (e.g. 'user', 'workflow')"
          },
          "entry": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "webui",
                  "api"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Entry",
            "description": "How the session is driven. 'api': a program creates and runs it, with nobody in the WebUI to answer a prompt. Omitted: 'webui'."
          },
          "model_auto": {
            "type": "boolean",
            "title": "Model Auto",
            "description": "Enable WebUI runtime model failover for this session",
            "default": false
          }
        },
        "type": "object",
        "title": "SessionCreateRequest",
        "description": "Request to create a new session\n\nSchema follows standard Session.create format (matches Flocks):\n- parentID: optional parent session ID\n- title: optional session title\n- permission: optional permission ruleset\n\nNote: Model is not stored at session level (matches Flocks).\nModel is selected per-message based on priority:\nrequest.model > agent.model > lastModel > defaultModel"
      },
      "FileDiff": {
        "properties": {
          "file": {
            "type": "string",
            "title": "File",
            "description": "File path"
          },
          "before": {
            "type": "string",
            "title": "Before",
            "description": "Content before changes",
            "default": ""
          },
          "after": {
            "type": "string",
            "title": "After",
            "description": "Content after changes",
            "default": ""
          },
          "additions": {
            "type": "integer",
            "title": "Additions",
            "description": "Lines added",
            "default": 0
          },
          "deletions": {
            "type": "integer",
            "title": "Deletions",
            "description": "Lines deleted",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "file"
        ],
        "title": "FileDiff",
        "description": "File diff info for API compatibility"
      },
      "SessionListItem": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "projectID": {
            "type": "string",
            "title": "Projectid"
          },
          "projectName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Projectname"
          },
          "effectiveProjectID": {
            "type": "string",
            "title": "Effectiveprojectid"
          },
          "directory": {
            "type": "string",
            "title": "Directory"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "time": {
            "$ref": "#/components/schemas/SessionTime"
          },
          "category": {
            "type": "string",
            "title": "Category",
            "default": "user"
          },
          "channelID": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Channelid"
          },
          "channelChatType": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ChatType"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "title": "Status",
            "default": "active"
          },
          "parentID": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parentid"
          },
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "model_pinned": {
            "type": "boolean",
            "title": "Model Pinned",
            "default": false
          },
          "model_auto": {
            "type": "boolean",
            "title": "Model Auto",
            "default": false
          },
          "ownerUserID": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Owneruserid"
          },
          "ownerUsername": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ownerusername"
          },
          "canWrite": {
            "type": "boolean",
            "title": "Canwrite",
            "default": false
          },
          "canDelete": {
            "type": "boolean",
            "title": "Candelete",
            "default": false
          },
          "isShared": {
            "type": "boolean",
            "title": "Isshared",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "id",
          "projectID",
          "effectiveProjectID",
          "directory",
          "title",
          "time"
        ],
        "title": "SessionListItem",
        "description": "Lightweight session row for the session manager sidebar."
      },
      "ChatType": {
        "type": "string",
        "enum": [
          "direct",
          "group",
          "channel"
        ],
        "title": "ChatType"
      },
      "PermissionInfo": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "sessionID": {
            "type": "string",
            "title": "Sessionid"
          },
          "messageID": {
            "type": "string",
            "title": "Messageid"
          },
          "toolID": {
            "type": "string",
            "title": "Toolid"
          },
          "permission": {
            "type": "string",
            "title": "Permission"
          },
          "patterns": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Patterns"
          },
          "always": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Always"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object",
            "title": "Metadata"
          },
          "time": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Time"
          }
        },
        "type": "object",
        "required": [
          "id",
          "sessionID",
          "messageID",
          "toolID",
          "permission",
          "patterns",
          "always",
          "metadata",
          "time"
        ],
        "title": "PermissionInfo",
        "description": "Permission info for API response"
      },
      "PromptQueueUpdateRequest": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text",
            "description": "Updated queued prompt text"
          }
        },
        "type": "object",
        "required": [
          "text"
        ],
        "title": "PromptQueueUpdateRequest"
      },
      "SessionStatusDreaming": {
        "properties": {
          "type": {
            "type": "string",
            "const": "dreaming",
            "title": "Type",
            "default": "dreaming"
          },
          "message": {
            "type": "string",
            "title": "Message",
            "description": "Display message"
          }
        },
        "type": "object",
        "required": [
          "message"
        ],
        "title": "SessionStatusDreaming",
        "description": "Dreaming status - manual self-improvement is in progress."
      },
      "MessageWithParts": {
        "properties": {
          "info": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UserMessageInfo"
              },
              {
                "$ref": "#/components/schemas/AssistantMessageInfo"
              }
            ],
            "title": "Info"
          },
          "parts": {
            "items": {
              "$ref": "#/components/schemas/MessagePartInfo"
            },
            "type": "array",
            "title": "Parts",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "info"
        ],
        "title": "MessageWithParts",
        "description": "Message with parts for API compatibility"
      },
      "PermissionRule": {
        "properties": {
          "permission": {
            "type": "string",
            "title": "Permission",
            "description": "Permission name (tool name)"
          },
          "action": {
            "type": "string",
            "enum": [
              "allow",
              "deny"
            ],
            "title": "Action",
            "description": "Action: allow or deny",
            "default": "allow"
          },
          "pattern": {
            "type": "string",
            "title": "Pattern",
            "description": "Pattern to match",
            "default": "*"
          }
        },
        "type": "object",
        "required": [
          "permission"
        ],
        "title": "PermissionRule",
        "description": "Permission rule for API compatibility"
      },
      "SessionExecutionMode": {
        "type": "string",
        "enum": [
          "build",
          "plan",
          "goal"
        ],
        "title": "SessionExecutionMode",
        "description": "Execution mode selected for a user turn."
      },
      "PromptRequest": {
        "properties": {
          "parts": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Parts",
            "description": "Message parts"
          },
          "model": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ModelInfo"
              },
              {
                "type": "null"
              }
            ],
            "description": "Model selection"
          },
          "messageID": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Messageid",
            "description": "Message ID"
          },
          "agent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent",
            "description": "Agent name"
          },
          "displayText": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Displaytext",
            "description": "User-visible message text"
          },
          "noReply": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Noreply",
            "description": "Skip AI response"
          },
          "mockReply": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mockreply",
            "description": "Inject a mock assistant message after noReply user message"
          },
          "tools": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "boolean"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tools",
            "description": "Tool settings (deprecated)"
          },
          "system": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "System",
            "description": "System prompt override"
          },
          "variant": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Variant",
            "description": "Model variant"
          },
          "executionMode": {
            "$ref": "#/components/schemas/SessionExecutionMode",
            "description": "Execution mode for this user turn",
            "default": "build"
          },
          "turnID": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Turnid",
            "description": "Client-chosen id of this turn; GET /session/{id}/turn/{turnID} says how it stands"
          }
        },
        "type": "object",
        "title": "PromptRequest",
        "description": "Request to send a prompt/message\n\nSchema follows standard SessionPrompt.PromptInput format"
      },
      "UserMessageInfo": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "sessionID": {
            "type": "string",
            "title": "Sessionid"
          },
          "role": {
            "type": "string",
            "const": "user",
            "title": "Role",
            "default": "user"
          },
          "time": {
            "additionalProperties": true,
            "type": "object",
            "title": "Time"
          },
          "agent": {
            "type": "string",
            "title": "Agent",
            "default": "rex"
          },
          "model": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Model"
          },
          "summary": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Summary"
          },
          "system": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "System"
          },
          "tools": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "boolean"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tools"
          },
          "variant": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Variant"
          },
          "compacted": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Compacted"
          },
          "executionMode": {
            "$ref": "#/components/schemas/SessionExecutionMode",
            "default": "build"
          }
        },
        "type": "object",
        "required": [
          "id",
          "sessionID",
          "time",
          "model"
        ],
        "title": "UserMessageInfo",
        "description": "User message info - Flocks TUI compatible format.\n\nFlocks expects:\n{\n    \"id\": string,\n    \"sessionID\": string,\n    \"role\": \"user\",\n    \"time\": { \"created\": number },\n    \"agent\": string,\n    \"model\": { \"providerID\": string, \"modelID\": string },\n    // optional fields...\n}"
      },
      "SessionResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Session ID"
          },
          "slug": {
            "type": "string",
            "title": "Slug",
            "description": "Session slug",
            "default": ""
          },
          "projectID": {
            "type": "string",
            "title": "Projectid",
            "description": "Project ID"
          },
          "effectiveProjectID": {
            "type": "string",
            "title": "Effectiveprojectid",
            "description": "Project used for session manager grouping"
          },
          "directory": {
            "type": "string",
            "title": "Directory",
            "description": "Working directory"
          },
          "parentID": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parentid",
            "description": "Parent session ID"
          },
          "summary": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Summary",
            "description": "Session summary with diffs"
          },
          "title": {
            "type": "string",
            "title": "Title",
            "description": "Session title"
          },
          "version": {
            "type": "string",
            "title": "Version",
            "description": "Session version",
            "default": "1.0.0"
          },
          "time": {
            "$ref": "#/components/schemas/SessionTime",
            "description": "Session timestamps"
          },
          "permission": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Permission",
            "description": "Permission rules"
          },
          "revert": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revert",
            "description": "Revert state"
          },
          "category": {
            "type": "string",
            "title": "Category",
            "description": "Session category: user or task",
            "default": "user"
          },
          "status": {
            "type": "string",
            "title": "Status",
            "description": "Session status: active or archived",
            "default": "active"
          },
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider",
            "description": "Pinned provider ID"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model",
            "description": "Pinned model ID"
          },
          "model_pinned": {
            "type": "boolean",
            "title": "Model Pinned",
            "description": "Whether provider/model are pinned for this session",
            "default": false
          },
          "model_auto": {
            "type": "boolean",
            "title": "Model Auto",
            "description": "Whether WebUI Auto mode is selected",
            "default": false
          },
          "ownerUserID": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Owneruserid",
            "description": "Session owner user id"
          },
          "ownerUsername": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ownerusername",
            "description": "Session owner username"
          },
          "canWrite": {
            "type": "boolean",
            "title": "Canwrite",
            "description": "Whether current user can continue this session",
            "default": false
          },
          "canDelete": {
            "type": "boolean",
            "title": "Candelete",
            "description": "Whether current user can delete this session",
            "default": false
          },
          "isShared": {
            "type": "boolean",
            "title": "Isshared",
            "description": "Whether this session is locally shared",
            "default": false
          },
          "goal": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SessionGoalResponse"
              },
              {
                "type": "null"
              }
            ],
            "description": "Persisted session goal state"
          }
        },
        "type": "object",
        "required": [
          "id",
          "projectID",
          "effectiveProjectID",
          "directory",
          "title",
          "time"
        ],
        "title": "SessionResponse",
        "description": "Session response - Flocks compatible\n\nMatches Flocks Session.Info format."
      },
      "SessionTime": {
        "properties": {
          "created": {
            "type": "integer",
            "title": "Created",
            "description": "Creation timestamp (ms)"
          },
          "updated": {
            "type": "integer",
            "title": "Updated",
            "description": "Last update timestamp (ms)"
          },
          "compacting": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Compacting",
            "description": "Compaction timestamp (ms)"
          },
          "archived": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Archived",
            "description": "Archive timestamp (ms)"
          }
        },
        "type": "object",
        "required": [
          "created",
          "updated"
        ],
        "title": "SessionTime",
        "description": "Session time information for API compatibility"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "AgentModelInfo": {
        "properties": {
          "modelID": {
            "type": "string",
            "title": "Modelid"
          },
          "providerID": {
            "type": "string",
            "title": "Providerid"
          }
        },
        "type": "object",
        "required": [
          "modelID",
          "providerID"
        ],
        "title": "AgentModelInfo",
        "description": "Agent model configuration"
      },
      "AgentResponse": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "nameCn": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Namecn"
          },
          "group": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Group"
          },
          "group_readonly": {
            "type": "boolean",
            "title": "Group Readonly",
            "default": false
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "descriptionCn": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Descriptioncn"
          },
          "mode": {
            "type": "string",
            "title": "Mode",
            "default": "primary"
          },
          "native": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Native",
            "default": true
          },
          "hidden": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hidden",
            "default": false
          },
          "topP": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Topp"
          },
          "temperature": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Temperature"
          },
          "color": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Color"
          },
          "permission": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Permission"
          },
          "model": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AgentModelInfo"
              },
              {
                "type": "null"
              }
            ]
          },
          "prompt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prompt"
          },
          "promptProtected": {
            "type": "boolean",
            "title": "Promptprotected",
            "default": false
          },
          "options": {
            "additionalProperties": true,
            "type": "object",
            "title": "Options"
          },
          "delegatable": {
            "type": "boolean",
            "title": "Delegatable",
            "default": true
          },
          "steps": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Steps"
          },
          "skills": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Skills"
          },
          "tools": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Tools"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Tags"
          }
        },
        "type": "object",
        "required": [
          "name"
        ],
        "title": "AgentResponse",
        "description": "Agent response - Flocks TUI compatible format.\n\nIncludes required 'permission' and 'options' fields."
      },
      "MessagePage": {
        "properties": {
          "sessionID": {
            "type": "string",
            "title": "Sessionid"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/MessageWithParts"
            },
            "type": "array",
            "title": "Items",
            "default": []
          },
          "hasMore": {
            "type": "boolean",
            "title": "Hasmore",
            "default": false
          },
          "nextBefore": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Nextbefore"
          },
          "hasNewer": {
            "type": "boolean",
            "title": "Hasnewer",
            "default": false
          },
          "nextAfter": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Nextafter"
          }
        },
        "type": "object",
        "required": [
          "sessionID"
        ],
        "title": "MessagePage",
        "description": "Paged message response used by the WebUI session page."
      },
      "SessionDetailResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Session ID"
          },
          "slug": {
            "type": "string",
            "title": "Slug",
            "description": "Session slug",
            "default": ""
          },
          "projectID": {
            "type": "string",
            "title": "Projectid",
            "description": "Project ID"
          },
          "effectiveProjectID": {
            "type": "string",
            "title": "Effectiveprojectid",
            "description": "Project used for session manager grouping"
          },
          "directory": {
            "type": "string",
            "title": "Directory",
            "description": "Working directory"
          },
          "parentID": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parentid",
            "description": "Parent session ID"
          },
          "summary": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Summary",
            "description": "Session summary with diffs"
          },
          "title": {
            "type": "string",
            "title": "Title",
            "description": "Session title"
          },
          "version": {
            "type": "string",
            "title": "Version",
            "description": "Session version",
            "default": "1.0.0"
          },
          "time": {
            "$ref": "#/components/schemas/SessionTime",
            "description": "Session timestamps"
          },
          "permission": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Permission",
            "description": "Permission rules"
          },
          "revert": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revert",
            "description": "Revert state"
          },
          "category": {
            "type": "string",
            "title": "Category",
            "description": "Session category: user or task",
            "default": "user"
          },
          "status": {
            "type": "string",
            "title": "Status",
            "description": "Session status: active or archived",
            "default": "active"
          },
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider",
            "description": "Pinned provider ID"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model",
            "description": "Pinned model ID"
          },
          "model_pinned": {
            "type": "boolean",
            "title": "Model Pinned",
            "description": "Whether provider/model are pinned for this session",
            "default": false
          },
          "model_auto": {
            "type": "boolean",
            "title": "Model Auto",
            "description": "Whether WebUI Auto mode is selected",
            "default": false
          },
          "ownerUserID": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Owneruserid",
            "description": "Session owner user id"
          },
          "ownerUsername": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ownerusername",
            "description": "Session owner username"
          },
          "canWrite": {
            "type": "boolean",
            "title": "Canwrite",
            "description": "Whether current user can continue this session",
            "default": false
          },
          "canDelete": {
            "type": "boolean",
            "title": "Candelete",
            "description": "Whether current user can delete this session",
            "default": false
          },
          "isShared": {
            "type": "boolean",
            "title": "Isshared",
            "description": "Whether this session is locally shared",
            "default": false
          },
          "goal": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SessionGoalResponse"
              },
              {
                "type": "null"
              }
            ],
            "description": "Persisted session goal state"
          },
          "webUrl": {
            "type": "string",
            "title": "Weburl",
            "description": "Relative WebUI path; browser access requires session read permission"
          }
        },
        "type": "object",
        "required": [
          "id",
          "projectID",
          "effectiveProjectID",
          "directory",
          "title",
          "time",
          "webUrl"
        ],
        "title": "SessionDetailResponse"
      },
      "SummarizeRequest": {
        "properties": {
          "providerID": {
            "type": "string",
            "title": "Providerid",
            "description": "Provider ID"
          },
          "modelID": {
            "type": "string",
            "title": "Modelid",
            "description": "Model ID"
          },
          "auto": {
            "type": "boolean",
            "title": "Auto",
            "description": "Auto compaction mode",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "providerID",
          "modelID"
        ],
        "title": "SummarizeRequest",
        "description": "Request to summarize session"
      },
      "ShellRequest": {
        "properties": {
          "agent": {
            "type": "string",
            "title": "Agent",
            "description": "Agent name"
          },
          "command": {
            "type": "string",
            "title": "Command",
            "description": "Shell command to execute"
          },
          "model": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ModelInfo"
              },
              {
                "type": "null"
              }
            ],
            "description": "Model selection"
          }
        },
        "type": "object",
        "required": [
          "agent",
          "command"
        ],
        "title": "ShellRequest",
        "description": "Request to run shell command"
      },
      "QuestionRequestReply": {
        "properties": {
          "answers": {
            "items": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "type": "array",
            "title": "Answers"
          }
        },
        "type": "object",
        "required": [
          "answers"
        ],
        "title": "QuestionRequestReply",
        "description": "Batch reply: one answer-list per question."
      },
      "InitRequest": {
        "properties": {
          "modelID": {
            "type": "string",
            "title": "Modelid",
            "description": "Model ID"
          },
          "providerID": {
            "type": "string",
            "title": "Providerid",
            "description": "Provider ID"
          },
          "messageID": {
            "type": "string",
            "title": "Messageid",
            "description": "Message ID"
          }
        },
        "type": "object",
        "required": [
          "modelID",
          "providerID",
          "messageID"
        ],
        "title": "InitRequest",
        "description": "Request to initialize session"
      },
      "AbortSessionResult": {
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "stopped",
              "requested",
              "unconfirmed",
              "not_running"
            ],
            "title": "Status"
          },
          "generation": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Generation"
          }
        },
        "type": "object",
        "required": [
          "status"
        ],
        "title": "AbortSessionResult",
        "description": "What an abort came to.\n\n``stopped``: the run has ended.  ``requested``: the node running it took\nthe request and is stopping it.  ``unconfirmed``: the request was recorded\n(or could not be), but no node answered for the run -- its node may be\ngone, and the run is released when its lease expires.  ``not_running``:\nnothing of the session was executing."
      },
      "ModelCapabilities": {
        "properties": {
          "streaming": {
            "type": "boolean",
            "title": "Streaming",
            "description": "Supports streaming",
            "default": true
          },
          "tools": {
            "type": "boolean",
            "title": "Tools",
            "description": "Supports tool calling",
            "default": true
          },
          "vision": {
            "type": "boolean",
            "title": "Vision",
            "description": "Supports vision/images",
            "default": false
          },
          "json_mode": {
            "type": "boolean",
            "title": "Json Mode",
            "description": "Supports JSON mode",
            "default": false
          }
        },
        "type": "object",
        "title": "ModelCapabilities",
        "description": "Model capabilities"
      },
      "ModelInfo": {
        "properties": {
          "providerID": {
            "type": "string",
            "title": "Providerid",
            "description": "Provider ID"
          },
          "modelID": {
            "type": "string",
            "title": "Modelid",
            "description": "Model ID"
          }
        },
        "type": "object",
        "required": [
          "providerID",
          "modelID"
        ],
        "title": "ModelInfo",
        "description": "Model selection info for API compatibility"
      },
      "ModelListResponse": {
        "properties": {
          "models": {
            "items": {
              "$ref": "#/components/schemas/ModelDetail"
            },
            "type": "array",
            "title": "Models"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "providers": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Providers"
          }
        },
        "type": "object",
        "required": [
          "models",
          "total",
          "providers"
        ],
        "title": "ModelListResponse",
        "description": "Response for model list"
      },
      "SessionUpdateRequest": {
        "properties": {
          "title": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Title",
            "description": "New title"
          },
          "time": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Time",
            "description": "Time updates (archived)"
          },
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider",
            "description": "Pinned provider ID"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model",
            "description": "Pinned model ID"
          },
          "model_pinned": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Pinned",
            "description": "Whether provider/model are pinned for this session"
          },
          "model_auto": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Auto",
            "description": "Whether WebUI Auto mode is selected"
          }
        },
        "type": "object",
        "title": "SessionUpdateRequest",
        "description": "Request to update session"
      },
      "RevertRequest": {
        "properties": {
          "messageID": {
            "type": "string",
            "title": "Messageid",
            "description": "Message ID to revert to"
          },
          "partID": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Partid",
            "description": "Part ID for partial revert"
          }
        },
        "type": "object",
        "required": [
          "messageID"
        ],
        "title": "RevertRequest",
        "description": "Request to revert session"
      },
      "PermissionReplyRequest": {
        "properties": {
          "allow": {
            "type": "boolean",
            "title": "Allow"
          },
          "always": {
            "type": "boolean",
            "title": "Always",
            "default": false
          },
          "response": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "trust_tool_network",
                  "trust_network_target"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Response"
          }
        },
        "type": "object",
        "required": [
          "allow"
        ],
        "title": "PermissionReplyRequest",
        "description": "Request to reply to a permission"
      },
      "SessionStatusBusy": {
        "properties": {
          "type": {
            "type": "string",
            "const": "busy",
            "title": "Type",
            "default": "busy"
          }
        },
        "type": "object",
        "title": "SessionStatusBusy",
        "description": "Busy status"
      },
      "CommandRequest": {
        "properties": {
          "command": {
            "type": "string",
            "title": "Command",
            "description": "Command name"
          },
          "arguments": {
            "type": "string",
            "title": "Arguments",
            "description": "Command arguments",
            "default": ""
          },
          "argumentsJson": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ],
            "title": "Argumentsjson",
            "description": "Structured command arguments"
          },
          "messageID": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Messageid",
            "description": "Message ID"
          },
          "agent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent",
            "description": "Agent name"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model",
            "description": "Model string (provider/model)"
          },
          "variant": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Variant",
            "description": "Model variant"
          },
          "parts": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parts",
            "description": "Additional parts"
          },
          "turnID": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Turnid",
            "description": "Client-chosen id of this turn; GET /session/{id}/turn/{turnID} says how it stands"
          }
        },
        "type": "object",
        "required": [
          "command"
        ],
        "title": "CommandRequest",
        "description": "Request to execute a command"
      },
      "SessionStatusQueued": {
        "properties": {
          "type": {
            "type": "string",
            "const": "queued",
            "title": "Type",
            "default": "queued"
          }
        },
        "type": "object",
        "title": "SessionStatusQueued",
        "description": "Queued status - accepted work is waiting to enter the session loop."
      },
      "SessionStatusCompacting": {
        "properties": {
          "type": {
            "type": "string",
            "const": "compacting",
            "title": "Type",
            "default": "compacting"
          },
          "message": {
            "type": "string",
            "title": "Message",
            "description": "Display message",
            "default": "Compacting context…"
          }
        },
        "type": "object",
        "title": "SessionStatusCompacting",
        "description": "Compacting status - context compression in progress"
      },
      "MessagePartInfo": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "messageID": {
            "type": "string",
            "title": "Messageid"
          },
          "sessionID": {
            "type": "string",
            "title": "Sessionid"
          },
          "type": {
            "type": "string",
            "title": "Type"
          },
          "text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Text"
          },
          "time": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Time"
          },
          "synthetic": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Synthetic"
          },
          "tool": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tool"
          },
          "state": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "State"
          },
          "callID": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Callid"
          },
          "metadata": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metadata"
          },
          "url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url"
          },
          "mime": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mime"
          },
          "filename": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filename"
          },
          "resourceID": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resourceid"
          }
        },
        "type": "object",
        "required": [
          "id",
          "messageID",
          "sessionID",
          "type"
        ],
        "title": "MessagePartInfo",
        "description": "Message part info for API compatibility"
      },
      "MessageEditRequest": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text",
            "description": "Updated raw text content"
          },
          "partID": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Partid",
            "description": "Specific text part ID to edit"
          }
        },
        "type": "object",
        "required": [
          "text"
        ],
        "title": "MessageEditRequest",
        "description": "Request to edit message text."
      },
      "SessionRuntimeStatusResponse": {
        "properties": {
          "sessionID": {
            "type": "string",
            "title": "Sessionid",
            "description": "Session ID"
          },
          "webUrl": {
            "type": "string",
            "title": "Weburl",
            "description": "Relative WebUI path; archived sessions may not be viewable"
          },
          "lifecycleStatus": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ],
            "title": "Lifecyclestatus",
            "description": "Persisted session lifecycle status"
          },
          "status": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SessionStatusIdle"
              },
              {
                "$ref": "#/components/schemas/SessionStatusQueued"
              },
              {
                "$ref": "#/components/schemas/SessionStatusBusy"
              },
              {
                "$ref": "#/components/schemas/SessionStatusRetry"
              },
              {
                "$ref": "#/components/schemas/SessionStatusCompacting"
              },
              {
                "$ref": "#/components/schemas/SessionStatusDreaming"
              }
            ],
            "title": "Status",
            "description": "Current runtime status"
          },
          "isProcessing": {
            "type": "boolean",
            "title": "Isprocessing",
            "description": "Whether accepted session work is still in progress"
          },
          "pendingPromptCount": {
            "type": "integer",
            "minimum": 0.0,
            "title": "Pendingpromptcount",
            "description": "Number of prompts waiting in the session queue",
            "default": 0
          },
          "observedAt": {
            "type": "integer",
            "title": "Observedat",
            "description": "Server observation timestamp in milliseconds"
          }
        },
        "type": "object",
        "required": [
          "sessionID",
          "webUrl",
          "lifecycleStatus",
          "status",
          "isProcessing",
          "observedAt"
        ],
        "title": "SessionRuntimeStatusResponse",
        "description": "Runtime status snapshot for one session."
      },
      "SessionStatusIdle": {
        "properties": {
          "type": {
            "type": "string",
            "const": "idle",
            "title": "Type",
            "default": "idle"
          }
        },
        "type": "object",
        "title": "SessionStatusIdle",
        "description": "Idle status"
      },
      "ContextFolderCreateRequest": {
        "properties": {
          "path": {
            "type": "string",
            "title": "Path"
          },
          "displayName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Displayname"
          }
        },
        "type": "object",
        "required": [
          "path"
        ],
        "title": "ContextFolderCreateRequest",
        "description": "Add one read-only folder to the Session Context UI."
      },
      "TodoInfo": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Todo ID"
          },
          "content": {
            "type": "string",
            "title": "Content",
            "description": "Task description"
          },
          "activeForm": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Activeform",
            "description": "Active/progressive task description"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "in_progress",
              "completed",
              "cancelled"
            ],
            "title": "Status",
            "description": "Status: pending, in_progress, completed, cancelled"
          },
          "priority": {
            "type": "string",
            "title": "Priority",
            "description": "Priority: high, medium, low",
            "default": "medium"
          }
        },
        "type": "object",
        "required": [
          "id",
          "content",
          "status"
        ],
        "title": "TodoInfo",
        "description": "Todo item info for API compatibility"
      },
      "SessionStatusRetry": {
        "properties": {
          "type": {
            "type": "string",
            "const": "retry",
            "title": "Type",
            "default": "retry"
          },
          "attempt": {
            "type": "integer",
            "title": "Attempt",
            "description": "Retry attempt number"
          },
          "message": {
            "type": "string",
            "title": "Message",
            "description": "Error message"
          },
          "next": {
            "type": "integer",
            "title": "Next",
            "description": "Next retry timestamp (ms)"
          },
          "maxAttempts": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Maxattempts",
            "description": "Retry budget for this kind of failure"
          },
          "rateLimited": {
            "type": "boolean",
            "title": "Ratelimited",
            "description": "True when the provider rejected the request as rate-limited (429)",
            "default": false
          },
          "providerID": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Providerid",
            "description": "Provider being retried"
          },
          "modelID": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Modelid",
            "description": "Model being retried"
          }
        },
        "type": "object",
        "required": [
          "attempt",
          "message",
          "next"
        ],
        "title": "SessionStatusRetry",
        "description": "Retry status.\n\nThe same object feeds both channels clients use: the ``session.status``\nSSE event and the ``/api/session/status`` poll they fall back to after a\nrefresh or a dropped stream. Keep every field a client needs here so the\ntwo never disagree."
      },
      "AssistantMessageInfo": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "sessionID": {
            "type": "string",
            "title": "Sessionid"
          },
          "role": {
            "type": "string",
            "const": "assistant",
            "title": "Role",
            "default": "assistant"
          },
          "time": {
            "additionalProperties": true,
            "type": "object",
            "title": "Time"
          },
          "parentID": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parentid"
          },
          "modelID": {
            "type": "string",
            "title": "Modelid"
          },
          "providerID": {
            "type": "string",
            "title": "Providerid"
          },
          "mode": {
            "type": "string",
            "title": "Mode",
            "default": "rex"
          },
          "agent": {
            "type": "string",
            "title": "Agent",
            "default": "rex"
          },
          "path": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Path"
          },
          "cost": {
            "type": "number",
            "title": "Cost",
            "default": 0.0
          },
          "tokens": {
            "additionalProperties": true,
            "type": "object",
            "title": "Tokens"
          },
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "summary": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Summary"
          },
          "finish": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finish"
          },
          "compacted": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Compacted"
          }
        },
        "type": "object",
        "required": [
          "id",
          "sessionID",
          "time",
          "modelID",
          "providerID",
          "path"
        ],
        "title": "AssistantMessageInfo",
        "description": "Assistant message info - Flocks TUI compatible format.\n\nFlocks expects:\n{\n    \"id\": string,\n    \"sessionID\": string,\n    \"role\": \"assistant\",\n    \"time\": { \"created\": number, \"completed\"?: number },\n    \"parentID\": string,\n    \"modelID\": string,\n    \"providerID\": string,\n    \"mode\": string,\n    \"agent\": string,\n    \"path\": { \"cwd\": string, \"root\": string },\n    \"cost\": number,\n    \"tokens\": { \"input\": number, \"output\": number, ... },\n    // optional fields...\n}"
      },
      "ForkRequest": {
        "properties": {
          "messageID": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Messageid",
            "description": "Message ID to fork up to"
          },
          "inclusive": {
            "type": "boolean",
            "title": "Inclusive",
            "default": false
          },
          "completedOnly": {
            "type": "boolean",
            "title": "Completedonly",
            "default": false
          }
        },
        "type": "object",
        "title": "ForkRequest",
        "description": "Request to fork session"
      },
      "SessionGoalResponse": {
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "active",
              "paused",
              "completed",
              "blocked"
            ],
            "title": "Status",
            "description": "Goal status"
          },
          "objective": {
            "type": "string",
            "title": "Objective",
            "description": "Goal objective"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason",
            "description": "Last goal judge reason"
          }
        },
        "type": "object",
        "required": [
          "status",
          "objective"
        ],
        "title": "SessionGoalResponse",
        "description": "Persisted goal state shown by the WebUI composer banner."
      }
    },
    "securitySchemes": {
      "BearerToken": {
        "type": "http",
        "scheme": "bearer"
      },
      "ApiToken": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Flocks-API-Token"
      }
    }
  },
  "security": [
    {
      "BearerToken": []
    },
    {
      "ApiToken": []
    }
  ]
}
