{
  "openapi": "3.1.0",
  "info": {
    "title": "唯杰开放智能体服务",
    "version": "1.0",
    "description": "服务根下的 /ai/v1。成功 JSON 通常为 {code:0,data,msg}。会话、运行、快照、文件引用按身份隔离。页面通道由浏览器 SDK 维护。"
  },
  "servers": [
    {
      "url": "../v1",
      "description": "相对部署前缀解析的服务地址"
    }
  ],
  "security": [
    {
      "Bearer": []
    }
  ],
  "paths": {
    "/bootstrap": {
      "get": {
        "operationId": "getBootstrap",
        "summary": "读取可用档案、模型与身份",
        "tags": [
          "服务"
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {}
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "app",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ]
      }
    },
    "/me/assistant-resources": {
      "get": {
        "operationId": "getMeAssistantResources",
        "summary": "读取可用于本轮的版本化资源引用",
        "tags": [
          "资源"
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "skills": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "ref": {
                                "$ref": "#/components/schemas/ResourceRef"
                              }
                            }
                          }
                        },
                        "mcp": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "ref": {
                                "$ref": "#/components/schemas/ResourceRef"
                              }
                            }
                          }
                        },
                        "templates": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "ref": {
                                "$ref": "#/components/schemas/TemplateRef"
                              }
                            }
                          }
                        },
                        "docProducts": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ]
      }
    },
    "/sessions": {
      "get": {
        "operationId": "getSessions",
        "summary": "列出本人会话",
        "tags": [
          "会话"
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Session"
                          }
                        }
                      }
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "app",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "bizType",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "bizId",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "required": false
          }
        ]
      },
      "post": {
        "operationId": "postSessions",
        "summary": "创建独立会话",
        "tags": [
          "会话"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewSession"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "$ref": "#/components/schemas/Session"
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sessions/{id}": {
      "get": {
        "operationId": "getSessionsId",
        "summary": "读取会话",
        "tags": [
          "会话"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "$ref": "#/components/schemas/Session"
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "patchSessionsId",
        "summary": "更改会话设置",
        "tags": [
          "会话"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string"
                  },
                  "mode": {
                    "$ref": "#/components/schemas/Mode"
                  },
                  "model": {
                    "type": "string"
                  },
                  "preferences": {
                    "type": "string",
                    "maxLength": 2048
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "$ref": "#/components/schemas/Session"
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteSessionsId",
        "summary": "删除自己的会话",
        "tags": [
          "会话"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "成功"
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sessions/{id}/messages": {
      "get": {
        "operationId": "getSessionsIdMessages",
        "summary": "读取会话消息",
        "tags": [
          "会话"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {}
                          }
                        }
                      }
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sessions/{id}/runs": {
      "post": {
        "operationId": "postSessionsIdRuns",
        "summary": "开始或重放同一运行",
        "tags": [
          "运行"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Run"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "$ref": "#/components/schemas/Accepted"
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/runs/{runId}/events": {
      "get": {
        "operationId": "getRunsRunIdEvents",
        "summary": "读取按序号可恢复的 SSE 事件",
        "tags": [
          "运行"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "afterSeq",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "流式运行事件；按 seq 去重，run.done 或 run.error 为终态",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/runs/{runId}/cancel": {
      "post": {
        "operationId": "postRunsRunIdCancel",
        "summary": "取消自己的运行",
        "tags": [
          "运行"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "成功"
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/runs/{runId}/approvals/{reqId}": {
      "post": {
        "operationId": "postRunsRunIdApprovalsReqId",
        "summary": "回应本人的确认请求",
        "tags": [
          "运行"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "reqId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "decision": {
                    "type": "string",
                    "enum": [
                      "approve",
                      "reject"
                    ]
                  },
                  "note": {
                    "type": "string"
                  }
                },
                "required": [
                  "decision"
                ]
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "成功"
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/uploads": {
      "post": {
        "operationId": "postUploads",
        "summary": "上传并取得当前身份的附件 ID",
        "tags": [
          "资料"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "size": {
                          "type": "integer"
                        },
                        "mimeType": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        }
                      }
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sessions/{id}/sources": {
      "get": {
        "operationId": "getSessionsIdSources",
        "summary": "列出引用的原文位置",
        "tags": [
          "资料"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Source"
                          }
                        }
                      }
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sessions/{id}/sources/{sourceId}": {
      "get": {
        "operationId": "getSessionsIdSourcesSourceId",
        "summary": "按会话读取引用原文",
        "tags": [
          "资料"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "$ref": "#/components/schemas/Source"
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/me/skills": {
      "get": {
        "operationId": "getMeSkills",
        "summary": "列出可用的个人及共享技能",
        "tags": [
          "Skills"
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {}
                          }
                        }
                      }
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "postMeSkills",
        "summary": "新建技能版本",
        "tags": [
          "Skills"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Skill"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {}
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/me/skills/{skill}": {
      "get": {
        "operationId": "getMeSkillsSkill",
        "summary": "读取技能及参考文本",
        "tags": [
          "Skills"
        ],
        "parameters": [
          {
            "name": "skill",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {}
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "putMeSkillsSkill",
        "summary": "更新技能，须传当前 version",
        "tags": [
          "Skills"
        ],
        "parameters": [
          {
            "name": "skill",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Skill"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {}
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteMeSkillsSkill",
        "summary": "删除自己创建的技能",
        "tags": [
          "Skills"
        ],
        "parameters": [
          {
            "name": "skill",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "成功"
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/me/sharing-scopes": {
      "get": {
        "operationId": "getMeSharingScopes",
        "summary": "获取本人的团队和项目",
        "tags": [
          "成果"
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "teams": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "projects": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/me/artifacts": {
      "get": {
        "operationId": "getMeArtifacts",
        "summary": "列出可见成果",
        "tags": [
          "成果"
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {}
                          }
                        }
                      }
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "sessionId",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ]
      }
    },
    "/sessions/{id}/artifacts": {
      "post": {
        "operationId": "postSessionsIdArtifacts",
        "summary": "保存明确选择的正文快照",
        "tags": [
          "成果"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Artifact"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {}
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/artifacts/{artifact}": {
      "get": {
        "operationId": "getArtifactsArtifact",
        "summary": "读取独立成果",
        "tags": [
          "成果"
        ],
        "parameters": [
          {
            "name": "artifact",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "artifact": {
                          "type": "object",
                          "properties": {}
                        },
                        "canEdit": {
                          "type": "boolean"
                        }
                      }
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "patchArtifactsArtifact",
        "summary": "修改或撤回共享",
        "tags": [
          "成果"
        ],
        "parameters": [
          {
            "name": "artifact",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Visibility"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "$ref": "#/components/schemas/Visibility"
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteArtifactsArtifact",
        "summary": "删除所拥有的成果",
        "tags": [
          "成果"
        ],
        "parameters": [
          {
            "name": "artifact",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "成功"
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sessions/{id}/analysis/snapshots": {
      "get": {
        "operationId": "getSessionsIdAnalysisSnapshots",
        "summary": "读取会话内的快照摘要",
        "tags": [
          "分析"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {}
                          }
                        }
                      }
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "postSessionsIdAnalysisSnapshots",
        "summary": "导入受限 JSON 快照",
        "tags": [
          "分析"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Snapshot"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {}
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sessions/{id}/analysis": {
      "post": {
        "operationId": "postSessionsIdAnalysis",
        "summary": "在独立 worker 里计算分组和指标",
        "tags": [
          "分析"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Analysis"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "snapshot": {
                          "type": "string"
                        },
                        "digest": {
                          "type": "string"
                        },
                        "rows": {
                          "type": "integer"
                        },
                        "total": {
                          "type": "integer"
                        },
                        "partial": {
                          "type": "boolean"
                        },
                        "result": {
                          "type": "object",
                          "properties": {}
                        }
                      }
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/admin/mcp-servers": {
      "get": {
        "operationId": "getAdminMcpServers",
        "summary": "列出已安装连接器（凭据遮盖）",
        "tags": [
          "MCP"
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {}
                      }
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "postAdminMcpServers",
        "summary": "创建 MCP 连接器",
        "tags": [
          "MCP"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Connector",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string",
                    "description": "HTTP(S) 地址，或 stdio 服务注册名"
                  },
                  "transport": {
                    "type": "string",
                    "enum": [
                      "streamable-http",
                      "sse"
                    ],
                    "default": "streamable-http"
                  },
                  "headers": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "enabled": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "name",
                  "url"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {}
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "平台共享服务按助手档案分配。"
      }
    },
    "/admin/mcp-servers/{id}": {
      "patch": {
        "operationId": "patchAdminMcpServersId",
        "summary": "更新凭据、档案或启用状态",
        "tags": [
          "MCP"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Connector",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string",
                    "description": "HTTP(S) 地址，或 stdio 服务注册名"
                  },
                  "transport": {
                    "type": "string",
                    "enum": [
                      "streamable-http",
                      "sse"
                    ],
                    "default": "streamable-http"
                  },
                  "headers": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "enabled": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {}
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "平台共享服务按助手档案分配。"
      },
      "delete": {
        "operationId": "deleteAdminMcpServersId",
        "summary": "移除连接器",
        "tags": [
          "MCP"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "成功"
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/admin/mcp-servers/{id}/probe": {
      "post": {
        "operationId": "postAdminMcpServersIdProbe",
        "summary": "建立连接并读取远端工具和 schema 摘要",
        "tags": [
          "MCP"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "tools": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {}
                          }
                        },
                        "schemaVersion": {
                          "type": "string"
                        },
                        "ref": {
                          "$ref": "#/components/schemas/ResourceRef"
                        }
                      }
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/enduser/token": {
      "post": {
        "operationId": "postEnduserToken",
        "summary": "由客户业务后端为已认证的终端用户换取短令牌",
        "tags": [
          "身份"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "endUser": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "ttlSec": {
                    "type": "integer"
                  }
                },
                "required": [
                  "endUser"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "token": {
                          "type": "string"
                        },
                        "expiresAt": {
                          "type": "integer"
                        },
                        "endUser": {
                          "type": "string"
                        }
                      }
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/live/ticket": {
      "post": {
        "operationId": "postLiveTicket",
        "summary": "为浏览器 WebSocket 换取一次性票据",
        "tags": [
          "SDK"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "app": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  },
                  "pageId": {
                    "type": "string"
                  },
                  "bizRef": {
                    "$ref": "#/components/schemas/BizRef"
                  }
                },
                "required": [
                  "app",
                  "title"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "ticket": {
                          "type": "string"
                        },
                        "pageId": {
                          "type": "string"
                        },
                        "expiresAt": {
                          "type": "integer"
                        }
                      }
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "operationId": "postMcp",
        "summary": "外部 MCP Streamable HTTP 接入",
        "tags": [
          "MCP"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string"
                  },
                  "params": {
                    "type": "object",
                    "properties": {}
                  }
                },
                "required": [
                  "jsonrpc",
                  "method"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC 响应或 SSE",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "202": {
            "description": "接受 JSON-RPC 通知"
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "使用具备 ai.mcp 范围的个人令牌。vjmap_agent_ask 接受 task、profile、已有 sessionId、本会话 clientMessageId、options。视图联动另需 ai.view 及页面显式开启。"
      }
    },
    "/sessions/{id}/runs/{runId}/options": {
      "get": {
        "operationId": "getRunOptions",
        "summary": "运行受理时生效的用户级参数，仅本人可读",
        "tags": [
          "资源"
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "effectiveInstructions": {
                          "type": "string"
                        },
                        "preferences": {
                          "type": "string"
                        },
                        "profileVersion": {
                          "type": "string"
                        },
                        "model": {
                          "type": "string"
                        },
                        "mode": {
                          "$ref": "#/components/schemas/Mode"
                        },
                        "options": {
                          "type": "object"
                        }
                      }
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/me/connectors/{id}/schema": {
      "get": {
        "operationId": "getBoundConnectorSchema",
        "summary": "发现当前档案授权的 MCP 工具及结构版本",
        "tags": [
          "资源"
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "tools": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "remoteName": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "inputSchema": {
                                "type": "object"
                              },
                              "readOnly": {
                                "type": "boolean"
                              }
                            }
                          }
                        },
                        "schemaVersion": {
                          "type": "string"
                        },
                        "ref": {
                          "$ref": "#/components/schemas/ResourceRef"
                        }
                      }
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/runs/{runId}/widgets/{widgetId}": {
      "post": {
        "operationId": "answerRunWidget",
        "summary": "用当前用户作答运行中的确认、选择或表单",
        "tags": [
          "运行"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "widgetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "answer": {}
                },
                "required": [
                  "answer"
                ]
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "成功"
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/me/mcp-servers": {
      "get": {
        "operationId": "getPersonalMcpServers",
        "summary": "个人 MCP · 列出已安装连接器（凭据遮盖）",
        "tags": [
          "MCP"
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {}
                      }
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "登录用户管理自己的 Streamable HTTP 连接。凭据写入后遮盖。访问外部端点遵循本部署的出站网络策略。"
      },
      "post": {
        "operationId": "postPersonalMcpServers",
        "summary": "个人 MCP · 创建 MCP 连接器",
        "tags": [
          "MCP"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Connector",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string",
                    "description": "HTTP(S) 地址，或 stdio 服务注册名"
                  },
                  "transport": {
                    "type": "string",
                    "enum": [
                      "streamable-http",
                      "sse",
                      "stdio"
                    ],
                    "default": "streamable-http"
                  },
                  "headers": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "enabled": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "name",
                  "url"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {}
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "个人服务启用后，所属用户的对话会自动发现其工具。"
      }
    },
    "/me/mcp-servers/{id}": {
      "patch": {
        "operationId": "patchPersonalMcpServersId",
        "summary": "个人 MCP · 更新凭据、档案或启用状态",
        "tags": [
          "MCP"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Connector",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string",
                    "description": "HTTP(S) 地址，或 stdio 服务注册名"
                  },
                  "transport": {
                    "type": "string",
                    "enum": [
                      "streamable-http",
                      "sse",
                      "stdio"
                    ],
                    "default": "streamable-http"
                  },
                  "headers": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "enabled": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {}
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "个人服务启用后，所属用户的对话会自动发现其工具。"
      },
      "delete": {
        "operationId": "deletePersonalMcpServersId",
        "summary": "个人 MCP · 移除连接器",
        "tags": [
          "MCP"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "成功"
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "登录用户管理自己的 Streamable HTTP 连接。凭据写入后遮盖。访问外部端点遵循本部署的出站网络策略。"
      }
    },
    "/me/mcp-servers/{id}/probe": {
      "post": {
        "operationId": "postPersonalMcpServersIdProbe",
        "summary": "个人 MCP · 建立连接并读取远端工具和 schema 摘要",
        "tags": [
          "MCP"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "const": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "tools": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {}
                          }
                        },
                        "schemaVersion": {
                          "type": "string"
                        },
                        "ref": {
                          "$ref": "#/components/schemas/ResourceRef"
                        }
                      }
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "服务错误，详见 errCode 与 msg。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "登录用户管理自己的 Streamable HTTP 连接。凭据写入后遮盖。访问外部端点遵循本部署的出站网络策略。"
      }
    }
  },
  "components": {
    "securitySchemes": {
      "Bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "IAM / OIDC platform access token、应用终端用户短令牌、按端点接受的个人令牌或服务端 API 密钥"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer"
          },
          "errCode": {
            "type": "string"
          },
          "msg": {
            "type": "string"
          },
          "details": {
            "type": "object",
            "properties": {}
          }
        },
        "required": [
          "code",
          "errCode",
          "msg"
        ]
      },
      "ResourceRef": {
        "type": "object",
        "properties": {
          "namespace": {
            "type": "string",
            "enum": [
              "skill",
              "custom-skill",
              "provider",
              "connector"
            ]
          },
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        },
        "required": [
          "namespace",
          "name",
          "version"
        ]
      },
      "BizRef": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "id": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "id"
        ]
      },
      "Mode": {
        "type": "string",
        "enum": [
          "ask",
          "agent",
          "plan"
        ]
      },
      "NewSession": {
        "type": "object",
        "properties": {
          "profile": {
            "type": "string"
          },
          "bizRef": {
            "$ref": "#/components/schemas/BizRef"
          },
          "title": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "mode": {
            "$ref": "#/components/schemas/Mode"
          },
          "preferences": {
            "type": "string",
            "maxLength": 2048
          }
        },
        "required": [
          "profile"
        ]
      },
      "Session": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "profile": {
            "type": "string"
          },
          "app": {
            "type": "string"
          },
          "bizRef": {
            "$ref": "#/components/schemas/BizRef"
          },
          "title": {
            "type": "string"
          },
          "mode": {
            "$ref": "#/components/schemas/Mode"
          },
          "model": {
            "type": "string"
          },
          "createdAt": {
            "type": "integer"
          },
          "updatedAt": {
            "type": "integer"
          },
          "preferences": {
            "type": "string",
            "maxLength": 2048
          }
        }
      },
      "Run": {
        "type": "object",
        "properties": {
          "clientMessageId": {
            "type": "string",
            "maxLength": 64,
            "description": "同会话同键同参重放，同键异参 HTTP 409"
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32000
          },
          "instructions": {
            "type": "string",
            "maxLength": 4096
          },
          "context": {
            "type": "object",
            "properties": {}
          },
          "attachments": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "pageId": {
            "type": "string"
          },
          "clientTools": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {}
            }
          },
          "mode": {
            "$ref": "#/components/schemas/Mode"
          },
          "model": {
            "type": "string"
          },
          "skillRefs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResourceRef"
            },
            "description": "省略表示使用已授权的档案目录；空数组表示本轮禁用该组资源。"
          },
          "connectorRefs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResourceRef"
            },
            "description": "省略表示使用已授权的档案目录；空数组表示本轮禁用该组资源。"
          },
          "toolAllowlist": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "省略表示使用已授权的档案目录；空数组表示本轮禁用该组资源。"
          },
          "toolChoice": {
            "type": "string",
            "enum": [
              "auto",
              "none"
            ]
          },
          "generation": {
            "type": "object",
            "properties": {
              "temperature": {
                "type": "number",
                "minimum": 0,
                "maximum": 2
              },
              "topP": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "maxOutputTokens": {
                "type": "integer",
                "minimum": 0,
                "maximum": 32768
              },
              "stop": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "maxItems": 4
              }
            }
          },
          "budget": {
            "type": "object",
            "properties": {
              "maxSteps": {
                "type": "integer"
              },
              "deadlineMs": {
                "type": "integer"
              },
              "maxToolCalls": {
                "type": "integer",
                "minimum": 0,
                "description": "实际调用上限，0 挡住所有工具执行；受助手档案上限约束。"
              }
            }
          },
          "responseFormat": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "text",
                  "json_schema"
                ]
              },
              "name": {
                "type": "string"
              },
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          },
          "template": {
            "$ref": "#/components/schemas/TemplateRef"
          },
          "instructionsMode": {
            "type": "string",
            "enum": [
              "append",
              "replace",
              "clear"
            ],
            "description": "clear 时 instructions 为空。版本模板先于用户级偏好。"
          },
          "connectorSchemas": {
            "type": "object",
            "maxProperties": 64,
            "additionalProperties": {
              "type": "string",
              "pattern": "^sha256:[a-f0-9]{64}$"
            },
            "description": "以连接器 ID 为键，同时选入 connectorRefs，用于固定已发现的远程工具结构。"
          },
          "docProducts": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 32,
            "description": "当前档案允许的文档产品标识。省略时使用档案范围，空数组关闭本轮产品文档检索。"
          }
        },
        "required": [
          "text"
        ]
      },
      "Accepted": {
        "type": "object",
        "properties": {
          "runId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "runId",
          "status"
        ]
      },
      "Source": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "runId": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "docs",
              "attachment"
            ]
          },
          "digest": {
            "type": "string"
          },
          "startLine": {
            "type": "integer"
          },
          "endLine": {
            "type": "integer"
          },
          "text": {
            "type": "string"
          }
        }
      },
      "Visibility": {
        "type": "object",
        "properties": {
          "scope": {
            "type": "string",
            "enum": [
              "private",
              "team",
              "project"
            ]
          },
          "scopeId": {
            "type": "string"
          }
        }
      },
      "Skill": {
        "type": "object",
        "properties": {
          "body": {
            "type": "string",
            "description": "含 name 与 description front matter 的 SKILL.md"
          },
          "files": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "references/ 下的 UTF-8 文本"
          },
          "scope": {
            "type": "string",
            "enum": [
              "private",
              "team",
              "project"
            ]
          },
          "scopeId": {
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        },
        "required": [
          "body"
        ]
      },
      "Artifact": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "format": {
            "type": "string",
            "enum": [
              "markdown",
              "json"
            ]
          },
          "body": {
            "type": "string"
          },
          "scope": {
            "type": "string",
            "enum": [
              "private",
              "team",
              "project"
            ]
          },
          "scopeId": {
            "type": "string"
          }
        },
        "required": [
          "title",
          "format",
          "body"
        ]
      },
      "Connector": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "writeOnly": true
          },
          "enabled": {
            "type": "boolean"
          },
          "profiles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "Analysis": {
        "type": "object",
        "properties": {
          "snapshot": {
            "type": "string"
          },
          "code": {
            "type": "string"
          }
        },
        "required": [
          "snapshot",
          "code"
        ]
      },
      "Snapshot": {
        "type": "object",
        "properties": {
          "resource": {
            "type": "string"
          },
          "rows": {
            "type": "array",
            "maxItems": 5000,
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "oneOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "number"
                    }
                  ]
                }
              },
              "required": [
                "id"
              ]
            }
          }
        },
        "required": [
          "resource",
          "rows"
        ]
      },
      "TemplateRef": {
        "type": "object",
        "properties": {
          "namespace": {
            "const": "template"
          },
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        },
        "required": [
          "namespace",
          "name",
          "version"
        ]
      }
    }
  }
}
