{ "swagger": "2.0", "info": { "contact": {} }, "paths": { "/api/v1/plugins": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "并集返回 (global ∪ 用户 active team) 两级 scope 下的 plugin,同名 team\u003eglobal 覆盖;disabled 仍返回但 enabled=false。", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【公共】plugin" ], "summary": "获取 Plugins 列表", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/domain.PluginListItem" } } } } ] } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/public/captcha/challenge": { "post": { "description": "CreateCaptcha", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【验证码】" ], "summary": "CreateCaptcha", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/gocap.ChallengeData" } } } } }, "/api/v1/public/captcha/redeem": { "post": { "description": "RedeemCaptcha", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【验证码】" ], "summary": "RedeemCaptcha", "parameters": [ { "description": "request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.RedeemCaptchaReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/gocap.VerificationResult" } } } } }, "/api/v1/server/config": { "get": { "description": "返回当前服务的产品形态、SaaS 区域和版本信息,用于前端区分部署形态和升级状态。", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【服务】配置信息" ], "summary": "获取服务配置", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ServerConfig" } } } ] } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/skills": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "并集返回 (global ∪ 用户 active team ∪ 用户个人) 三级 scope 下、enabled=true 的 skill。禁用的 skill 不返回。", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】任务管理" ], "summary": "获取本用户的 Skill 列表", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/domain.SkillListItem" } } } } ] } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/teams/admin": { "post": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "创建团队管理员,将用户添加到团队并设置为管理员角色", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】分组成员管理" ], "summary": "创建团队管理员", "parameters": [ { "description": "请求参数", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.AddTeamAdminReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.AddTeamAdminResp" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/teams/audits": { "get": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "查询审计日志列表,支持条件过滤和分页", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team管理员】审计日志" ], "summary": "查询审计日志", "parameters": [ { "type": "string", "name": "created_at_end", "in": "query" }, { "type": "string", "name": "created_at_start", "in": "query" }, { "type": "string", "name": "cursor", "in": "query" }, { "type": "integer", "name": "limit", "in": "query" }, { "type": "string", "name": "operation", "in": "query" }, { "type": "string", "name": "request", "in": "query" }, { "type": "string", "name": "response", "in": "query" }, { "type": "string", "name": "source_ip", "in": "query" }, { "type": "string", "name": "user_agent", "in": "query" }, { "type": "string", "name": "user_id", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/domain.ListAuditsResponse" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/teams/conversations": { "get": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "获取当前团队任务日志中的 user-input 对话列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】团队对话" ], "summary": "获取团队对话列表", "parameters": [ { "type": "string", "description": "分页游标", "name": "cursor", "in": "query" }, { "type": "integer", "description": "每页数量", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamConversationListResp" } } } ] } } } } }, "/api/v1/teams/dashboard": { "get": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "获取团队活跃、任务、耗时、Token 消耗趋势和洞察列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】团队概览" ], "summary": "获取团队管理概览", "parameters": [ { "type": "string", "description": "时间范围:today、7d、30d", "name": "range", "in": "query" } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamDashboardResp" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/teams/extension-packages": { "post": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "上传团队扩展包并导入 Skills 和团队镜像记录", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】扩展包管理" ], "summary": "上传团队扩展包", "parameters": [ { "type": "file", "description": "扩展包 zip", "name": "file", "in": "formData", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ImportTeamExtensionPackageResp" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/teams/groups": { "get": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "获取团队分组列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】分组成员管理" ], "summary": "获取团队分组列表", "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ListTeamGroupsResp" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "post": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "创建团队分组", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】分组成员管理" ], "summary": "创建团队分组", "parameters": [ { "description": "请求参数", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.AddTeamGroupReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamGroup" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/teams/groups/{group_id}": { "put": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "更新团队分组", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】分组成员管理" ], "summary": "更新团队分组", "parameters": [ { "type": "string", "description": "团队组ID", "name": "group_id", "in": "path", "required": true }, { "description": "请求参数", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateTeamGroupReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamGroup" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "delete": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "删除团队分组", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】分组成员管理" ], "summary": "删除团队分组", "parameters": [ { "type": "string", "description": "团队组ID", "name": "group_id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/teams/groups/{group_id}/users": { "get": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "获取团队组成员列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】分组成员管理" ], "summary": "获取团队组成员列表", "parameters": [ { "type": "string", "description": "团队组ID", "name": "group_id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ListTeamGroupUsersResp" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "put": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "修改团队组成员", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】分组成员管理" ], "summary": "修改团队组成员", "parameters": [ { "type": "string", "description": "团队组ID", "name": "group_id", "in": "path", "required": true }, { "description": "请求参数", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.AddTeamGroupUsersReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.AddTeamGroupUsersResp" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/teams/hosts": { "get": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "获取团队宿主机列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】宿主机管理" ], "summary": "获取团队宿主机列表", "parameters": [ { "type": "string", "description": "下一页标识", "name": "next_token", "in": "query" }, { "type": "integer", "description": "分页", "name": "page", "in": "query" }, { "type": "integer", "description": "每页多少条记录", "name": "size", "in": "query" } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ListTeamHostsResp" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/teams/hosts/install-command": { "get": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "获取宿主机安装命令", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】宿主机管理" ], "summary": "获取宿主机安装命令", "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.InstallCommand" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/teams/hosts/{host_id}": { "put": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "更新团队宿主机", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】宿主机管理" ], "summary": "更新团队宿主机", "parameters": [ { "type": "string", "description": "宿主机ID", "name": "host_id", "in": "path", "required": true }, { "description": "参数", "name": "param", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateTeamHostReq" } } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "delete": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "删除团队宿主机", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】宿主机管理" ], "summary": "删除团队宿主机", "parameters": [ { "type": "string", "description": "宿主机ID", "name": "host_id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/teams/images": { "get": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "获取团队镜像列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】镜像管理" ], "summary": "获取团队镜像列表", "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ListTeamImagesResp" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "post": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "添加团队镜像", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】镜像管理" ], "summary": "添加团队镜像", "parameters": [ { "description": "请求参数", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.AddTeamImageReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamImage" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/teams/images/{image_id}": { "put": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "更新团队镜像", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】镜像管理" ], "summary": "更新团队镜像", "parameters": [ { "type": "string", "description": "镜像ID", "name": "image_id", "in": "path", "required": true }, { "description": "请求参数", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateTeamImageReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamImage" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "delete": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "删除团队镜像", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】镜像管理" ], "summary": "删除团队镜像", "parameters": [ { "type": "string", "description": "镜像ID", "name": "image_id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/teams/mcp/upstreams": { "get": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】MCP 配置" ], "summary": "获取团队 MCP Upstream 列表", "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ListTeamMCPUpstreamsResp" } } } ] } } } }, "post": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】MCP 配置" ], "summary": "创建团队 MCP Upstream", "parameters": [ { "description": "请求参数", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.CreateTeamMCPUpstreamReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamMCPUpstream" } } } ] } } } } }, "/api/v1/teams/mcp/upstreams/{upstream_id}": { "put": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】MCP 配置" ], "summary": "更新团队 MCP Upstream", "parameters": [ { "type": "string", "description": "MCP Upstream ID", "name": "upstream_id", "in": "path", "required": true }, { "description": "请求参数", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateTeamMCPUpstreamReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamMCPUpstream" } } } ] } } } }, "delete": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】MCP 配置" ], "summary": "删除团队 MCP Upstream", "parameters": [ { "type": "string", "description": "MCP Upstream ID", "name": "upstream_id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/teams/mcp/upstreams/{upstream_id}/sync": { "post": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】MCP 配置" ], "summary": "同步团队 MCP Upstream", "parameters": [ { "type": "string", "description": "MCP Upstream ID", "name": "upstream_id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/teams/models": { "get": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "获取团队模型配置列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】模型管理" ], "summary": "获取团队模型配置列表", "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ListTeamModelsResp" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "post": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "添加团队模型配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】模型管理" ], "summary": "添加团队模型配置", "parameters": [ { "description": "请求参数", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.AddTeamModelReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamModel" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/teams/models/health-check": { "post": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "使用提供的配置进行健康检查,不更新数据库", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】模型管理" ], "summary": "检查团队模型健康状态(通过配置)", "parameters": [ { "description": "检查模型配置请求", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.CheckByConfigReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.CheckModelResp" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/teams/models/{id}/health-check": { "get": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "对指定团队模型进行健康检查,并更新检查结果到数据库", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】模型管理" ], "summary": "检查团队模型健康状态(通过ID)", "parameters": [ { "type": "string", "description": "模型配置ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.CheckModelResp" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "404": { "description": "资源不存在", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/teams/models/{model_id}": { "put": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "更新团队模型配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】模型管理" ], "summary": "更新团队模型配置", "parameters": [ { "type": "string", "description": "模型ID", "name": "model_id", "in": "path", "required": true }, { "description": "请求参数", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateTeamModelReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamModel" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "delete": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "删除团队模型配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】模型管理" ], "summary": "删除团队模型配置", "parameters": [ { "type": "string", "description": "模型ID", "name": "model_id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/teams/notify/channels": { "get": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "列出当前团队的所有推送渠道及其订阅配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】通知推送" ], "summary": "列出团队推送渠道", "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/domain.NotifyChannel" } } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "post": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "创建团队推送渠道(钉钉/飞书/企业微信/Webhook),同时配置订阅的事件类型", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】通知推送" ], "summary": "创建团队推送渠道", "parameters": [ { "description": "渠道参数", "name": "param", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.CreateNotifyChannelReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.NotifyChannel" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/teams/notify/channels/{id}": { "put": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "更新团队推送渠道配置及订阅的事件类型", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】通知推送" ], "summary": "更新团队推送渠道", "parameters": [ { "type": "string", "description": "渠道ID", "name": "id", "in": "path", "required": true }, { "description": "更新参数", "name": "param", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateNotifyChannelReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.NotifyChannel" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "delete": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "删除团队推送渠道及其关联的订阅", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】通知推送" ], "summary": "删除团队推送渠道", "parameters": [ { "type": "string", "description": "渠道ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/teams/notify/channels/{id}/test": { "post": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "发送测试消息验证渠道配置是否正确", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】通知推送" ], "summary": "测试团队推送渠道", "parameters": [ { "type": "string", "description": "渠道ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/teams/notify/event-types": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "列出所有支持订阅的事件类型", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "通知推送" ], "summary": "列出事件类型", "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/consts.NotifyEventTypeInfo" } } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/teams/oidc": { "get": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "获取当前团队企业登录 OIDC 配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】企业登录" ], "summary": "获取团队 OIDC 配置", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamOIDCConfigResp" } } } ] } } } }, "put": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "新增或更新当前团队企业登录 OIDC 配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】企业登录" ], "summary": "保存团队 OIDC 配置", "parameters": [ { "description": "请求参数", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.SaveTeamOIDCConfigReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamOIDCConfigResp" } } } ] } } } } }, "/api/v1/teams/oidc/test": { "post": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "拉取 OIDC discovery 文档验证配置可用性", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】企业登录" ], "summary": "测试团队 OIDC 配置", "parameters": [ { "description": "请求参数", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.SaveTeamOIDCConfigReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamOIDCTestResp" } } } ] } } } } }, "/api/v1/teams/projects": { "get": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "获取当前团队成员创建的项目列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】团队项目" ], "summary": "获取团队项目列表", "parameters": [ { "type": "string", "description": "分页游标", "name": "cursor", "in": "query" }, { "type": "integer", "description": "每页数量", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamProjectListResp" } } } ] } } } } }, "/api/v1/teams/skills": { "get": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】Skill 管理" ], "summary": "获取团队 Skill 列表", "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ListTeamSkillsResp" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "post": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】Skill 管理" ], "summary": "添加团队 Skill (JSON)", "parameters": [ { "description": "请求参数", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.AddTeamSkillReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamSkill" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/teams/skills/package": { "post": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】Skill 管理" ], "summary": "添加团队 Skill (multipart zip)", "parameters": [ { "type": "string", "description": "Skill 名称", "name": "name", "in": "formData", "required": true }, { "type": "string", "description": "Skill 描述", "name": "description", "in": "formData", "required": true }, { "type": "string", "description": "JSON 字符串数组", "name": "tags", "in": "formData" }, { "type": "string", "description": "SKILL.md 原文(可选)", "name": "content", "in": "formData" }, { "type": "string", "description": "JSON 字符串数组", "name": "group_ids", "in": "formData" }, { "type": "string", "description": "zip 内 SKILL.md 路径", "name": "skill_md_path", "in": "formData" }, { "type": "file", "description": "Skill zip 包", "name": "file", "in": "formData", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamSkill" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/teams/skills/{skill_id}": { "put": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "请求参数的 content 非空时,后端将 SKILL.md 重新打包上传 OSS 并创建新的 agent_skill_versions 并切到 active version 到新版本,否则仅更新当前版本的 description / tags / is_force_delivery / group_ids", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】Skill 管理" ], "summary": "更新团队 Skill", "parameters": [ { "type": "string", "description": "Skill ID", "name": "skill_id", "in": "path", "required": true }, { "description": "请求参数", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateTeamSkillReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamSkill" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "delete": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "从本团队 skill repo 中软删所选 agent skill", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】Skill 管理" ], "summary": "删除团队 Skill", "parameters": [ { "type": "string", "description": "Skill ID", "name": "skill_id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/teams/task-vm-idle-policy": { "get": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "获取当前团队任务创建开发环境的空闲休眠和回收策略", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】开发环境管理" ], "summary": "获取任务开发环境空闲策略", "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamTaskVMIdlePolicy" } } } ] } } } }, "put": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "更新当前团队任务创建开发环境的空闲休眠和回收策略", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】开发环境管理" ], "summary": "更新任务开发环境空闲策略", "parameters": [ { "description": "请求参数", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateTeamTaskVMIdlePolicyReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamTaskVMIdlePolicy" } } } ] } } } } }, "/api/v1/teams/tasks": { "get": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "获取当前团队成员创建的任务列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】团队任务" ], "summary": "获取团队任务列表", "parameters": [ { "type": "string", "description": "分页游标", "name": "cursor", "in": "query" }, { "type": "integer", "description": "每页数量", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamTaskListResp" } } } ] } } } } }, "/api/v1/teams/users": { "get": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "获取团队成员列表,支持按角色筛选", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】分组成员管理" ], "summary": "获取团队成员列表", "parameters": [ { "type": "string", "description": "团队成员角色筛选(可选值:admin, user)", "name": "role", "in": "query" } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.MemberListResp" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "post": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "创建团队成员,发送重置密码邮件", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】分组成员管理" ], "summary": "创建团队成员", "parameters": [ { "description": "请求参数", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.AddTeamUserReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.AddTeamUserResp" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/teams/users/login": { "post": { "description": "团队用户登录,password 字段需要传 MD5 加密后的值", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】认证" ], "summary": "团队用户登录", "parameters": [ { "description": "请求参数", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.TeamLoginReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamUser" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/teams/users/logout": { "post": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "团队用户登出", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】认证" ], "summary": "团队用户登出", "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/teams/users/passwords/change": { "put": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "修改当前用户的密码", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】认证" ], "summary": "修改密码", "parameters": [ { "description": "修改密码请求", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.ChangePasswordReq" } } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/teams/users/status": { "get": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "获取团队用户登录状态", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】认证" ], "summary": "获取团队用户登录状态", "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamUser" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/teams/users/with-password": { "post": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "创建团队成员,后端生成初始密码并只在响应中返回一次", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】分组成员管理" ], "summary": "创建团队成员并返回初始密码", "parameters": [ { "description": "请求参数", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.AddTeamUserReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.AddTeamUserWithPasswordResp" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/teams/users/{user_id}": { "put": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "更新团队成员信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】分组成员管理" ], "summary": "更新团队成员", "parameters": [ { "type": "string", "description": "用户ID", "name": "user_id", "in": "path", "required": true }, { "description": "请求参数", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateTeamUserReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.UpdateTeamUserResp" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "delete": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "软删除团队成员或管理员,不删除团队成员关系", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】分组成员管理" ], "summary": "删除团队成员", "parameters": [ { "type": "string", "description": "用户ID", "name": "user_id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/teams/users/{user_id}/passwords/reset": { "put": { "security": [ { "MonkeyCodeAITeamAuth": [] } ], "description": "管理员为团队成员生成新密码,密码只在响应中返回一次", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【Team 管理员】分组成员管理" ], "summary": "重置团队成员密码", "parameters": [ { "type": "string", "description": "用户ID", "name": "user_id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamUserPassword" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users": { "put": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "更新用户昵称和头像", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "【用户】用户" ], "summary": "更新用户信息", "parameters": [ { "type": "string", "description": "昵称", "name": "name", "in": "formData" }, { "type": "string", "description": "OSS 头像地址", "name": "avatar_url", "in": "formData" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.UpdateUserResp" } } } ] } } } } }, "/api/v1/users/email/bind-request": { "put": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "用户已登录状态下请求绑定邮箱,系统发送验证邮件", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】邮箱绑定" ], "summary": "发送邮箱绑定验证邮件", "parameters": [ { "description": "邮箱绑定请求", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.SendBindEmailVerificationReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/files": { "delete": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "删除文件/目录", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】文件管理" ], "summary": "删除文件/目录", "parameters": [ { "type": "string", "description": "虚拟机 id", "name": "id", "in": "query", "required": true }, { "type": "string", "description": "文件/目录路径", "name": "path", "in": "query", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/files/copy": { "post": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "复制文件/目录", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】文件管理" ], "summary": "复制文件/目录", "parameters": [ { "description": "参数", "name": "param", "in": "body", "schema": { "$ref": "#/definitions/domain.FileChangeReq" } } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/files/download": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "下载文件", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】文件管理" ], "summary": "下载文件", "parameters": [ { "type": "string", "description": "虚拟机 id", "name": "id", "in": "query", "required": true }, { "type": "string", "description": "文件/目录路径", "name": "path", "in": "query", "required": true }, { "type": "string", "description": "下载文件名", "name": "filename", "in": "query" } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/files/move": { "put": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "移动文件/目录", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】文件管理" ], "summary": "移动文件/目录", "parameters": [ { "description": "参数", "name": "param", "in": "body", "schema": { "$ref": "#/definitions/domain.FileChangeReq" } } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/files/save": { "put": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "保存文件内容", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】文件管理" ], "summary": "保存文件内容", "parameters": [ { "description": "参数", "name": "param", "in": "body", "schema": { "$ref": "#/definitions/domain.FileSaveReq" } } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/files/upload": { "post": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "上传文件", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】文件管理" ], "summary": "上传文件", "parameters": [ { "type": "string", "description": "虚拟机 id", "name": "id", "in": "query", "required": true }, { "type": "string", "description": "文件上传的绝对地址", "name": "path", "in": "query", "required": true }, { "type": "file", "description": "文件", "name": "file", "in": "formData", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/folders": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "目录列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】文件管理" ], "summary": "目录列表", "parameters": [ { "type": "string", "description": "虚拟机 id", "name": "id", "in": "query", "required": true }, { "type": "string", "description": "文件/目录路径", "name": "path", "in": "query", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/taskflow.File" } } } } ] } } } }, "post": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "创建目录", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "【用户】文件管理" ], "summary": "创建目录", "parameters": [ { "description": "参数", "name": "param", "in": "body", "schema": { "$ref": "#/definitions/domain.FilePathReq" } } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/git-bots": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "Git Bot 列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】Git Bot" ], "summary": "Git Bot 列表", "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ListGitBotResp" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "put": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "更新 Git Bot", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】Git Bot" ], "summary": "更新 Git Bot", "parameters": [ { "description": "参数", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateGitBotReq" } } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "post": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "创建 Git Bot", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】Git Bot" ], "summary": "创建 Git Bot", "parameters": [ { "description": "参数", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.CreateGitBotReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.GitBot" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/git-bots/share": { "post": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "分享 Git Bot", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】Git Bot" ], "summary": "分享 Git Bot", "parameters": [ { "description": "参数", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.ShareGitBotReq" } } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/git-bots/tasks": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "Git Bot 任务列表,支持分页", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】Git Bot" ], "summary": "Git Bot 任务列表", "parameters": [ { "type": "string", "name": "id", "in": "query" }, { "type": "integer", "name": "page", "in": "query" }, { "type": "integer", "name": "size", "in": "query" } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ListGitBotTaskResp" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/git-bots/{id}": { "delete": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "删除 Git Bot", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】Git Bot" ], "summary": "删除 Git Bot", "parameters": [ { "type": "string", "description": "ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/git-identities": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "获取当前用户的 Git 身份认证列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】git 身份管理" ], "summary": "列表", "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/domain.GitIdentity" } } } } ] } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "post": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "添加 Git 身份认证", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】git 身份管理" ], "summary": "添加", "parameters": [ { "description": "添加 Git 身份认证请求", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.AddGitIdentityReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.GitIdentity" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/git-identities/{identity_id}/{escaped_repo_full_name}/branches": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "根据 Git 身份获取指定仓库的分支列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】git 身份管理" ], "summary": "获取仓库分支列表", "parameters": [ { "type": "string", "description": "Git 身份认证ID", "name": "identity_id", "in": "path", "required": true }, { "type": "string", "description": "URL 编码的仓库全名 (owner%2Frepo)", "name": "escaped_repo_full_name", "in": "path", "required": true }, { "type": "integer", "description": "页码(默认1)", "name": "page", "in": "query" }, { "type": "integer", "description": "每页数量(默认50,最大100)", "name": "per_page", "in": "query" } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/domain.Branch" } } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "404": { "description": "资源不存在", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/git-identities/{id}": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "获取单个 Git 身份认证详情", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】git 身份管理" ], "summary": "详情", "parameters": [ { "type": "string", "description": "Git 身份认证ID", "name": "id", "in": "path", "required": true }, { "type": "boolean", "description": "是否刷新缓存", "name": "flush", "in": "query" }, { "type": "integer", "description": "页码(\u003e0 时启用分页,目前 GitHub/GitLab 支持)", "name": "page", "in": "query" }, { "type": "integer", "description": "每页数量(默认 20,上限 100)", "name": "size", "in": "query" }, { "type": "string", "description": "按仓库名关键字过滤", "name": "keyword", "in": "query" } ], "responses": { "200": { "description": "成功,分页时 data.repo_page_info 含 total_count/has_next_page", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.GitIdentity" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "404": { "description": "资源不存在", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "put": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "更新 Git 身份认证", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】git 身份管理" ], "summary": "更新", "parameters": [ { "type": "string", "description": "Git 身份认证ID", "name": "id", "in": "path", "required": true }, { "description": "更新 Git 身份认证请求", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateGitIdentityReq" } } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "404": { "description": "资源不存在", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "delete": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "删除 Git 身份认证", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】git 身份管理" ], "summary": "删除", "parameters": [ { "type": "string", "description": "Git 身份认证ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "404": { "description": "资源不存在", "schema": { "$ref": "#/definitions/web.Resp" } }, "409": { "description": "该 Git 身份已被项目使用,无法删除", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/hosts": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "获取主机列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】主机管理" ], "summary": "获取主机列表", "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.HostListResp" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/hosts/install-command": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "获取绑定宿主机命令", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】主机管理" ], "summary": "获取绑定宿主机命令", "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.InstallCommand" } } } ] } } } } }, "/api/v1/users/hosts/vms": { "put": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "修改虚拟机", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】主机管理" ], "summary": "修改虚拟机", "parameters": [ { "description": "修改虚拟机请求", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateVMReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.VirtualMachine" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "404": { "description": "虚拟机不存在", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "post": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "创建虚拟机", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】主机管理" ], "summary": "创建虚拟机", "parameters": [ { "description": "创建虚拟机请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.CreateVMReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.VirtualMachine" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/hosts/vms/terminals/join": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "通过 WebSocket 加入终端", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】终端连接管理" ], "summary": "通过 WebSocket 加入终端", "parameters": [ { "type": "integer", "name": "col", "in": "query" }, { "type": "string", "name": "password", "in": "query" }, { "type": "integer", "name": "row", "in": "query" }, { "type": "string", "name": "terminal_id", "in": "query" } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ShareTerminalResp" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/hosts/vms/{id}": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "获取虚拟机详情", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】主机管理" ], "summary": "获取虚拟机详情", "parameters": [ { "type": "string", "description": "虚拟机ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.VirtualMachine" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/hosts/vms/{id}/terminals": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "获取虚拟机终端session列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】终端连接管理" ], "summary": "获取虚拟机终端session列表", "parameters": [ { "type": "string", "description": "虚拟机ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/domain.Terminal" } } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/hosts/vms/{id}/terminals/connect": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "通过 WebSocket 连接到指定虚拟机的终端,支持双向通信", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】终端连接管理" ], "summary": "连接虚拟机终端", "parameters": [ { "type": "string", "description": "虚拟机ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "终端ID", "name": "terminal_id", "in": "query" }, { "type": "integer", "default": 80, "description": "终端列数", "name": "col", "in": "query" }, { "type": "integer", "default": 24, "description": "终端行数", "name": "row", "in": "query" } ], "responses": { "101": { "description": "WebSocket 连接成功", "schema": { "type": "string" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/hosts/vms/{id}/terminals/share": { "post": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "分享终端", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】终端连接管理" ], "summary": "分享终端", "parameters": [ { "description": "分享终端请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.ShareTerminalReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ShareTerminalResp" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/hosts/vms/{id}/terminals/{terminal_id}": { "delete": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "关闭虚拟机终端session", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】终端连接管理" ], "summary": "关闭虚拟机终端session", "parameters": [ { "type": "string", "description": "虚拟机ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "终端 id", "name": "terminal_id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/domain.Terminal" } } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/hosts/{host_id}/vms/{id}": { "delete": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "删除虚拟机", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】主机管理" ], "summary": "删除虚拟机", "parameters": [ { "type": "string", "description": "宿主机ID", "name": "host_id", "in": "path", "required": true }, { "type": "string", "description": "虚拟机ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "404": { "description": "虚拟机不存在", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/hosts/{host_id}/vms/{id}/ports": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "列出开发环境的监听端口", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】主机管理" ], "summary": "列出开发环境的监听端口", "parameters": [ { "type": "string", "description": "宿主机ID", "name": "host_id", "in": "path", "required": true }, { "type": "string", "description": "虚拟机ID", "name": "id", "in": "path", "required": true }, { "description": "申请端口请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.ApplyPortReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/domain.VMPort" } } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "post": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "为开发环境申请一个端口", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】主机管理" ], "summary": "申请端口", "parameters": [ { "type": "string", "description": "宿主机ID", "name": "host_id", "in": "path", "required": true }, { "type": "string", "description": "虚拟机ID", "name": "id", "in": "path", "required": true }, { "description": "申请端口请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.ApplyPortReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.VMPort" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/hosts/{host_id}/vms/{id}/ports/{port}": { "delete": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "为开发环境回收一个端口", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】主机管理" ], "summary": "回收端口", "parameters": [ { "type": "string", "description": "宿主机ID", "name": "host_id", "in": "path", "required": true }, { "type": "string", "description": "虚拟机ID", "name": "id", "in": "path", "required": true }, { "description": "回收端口请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.RecyclePortReq" } } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/hosts/{id}": { "put": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "更新宿主机", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】主机管理" ], "summary": "更新宿主机", "parameters": [ { "type": "string", "description": "宿主机ID", "name": "id", "in": "path", "required": true }, { "description": "更新宿主机请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateHostReq" } } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "delete": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "删除宿主机", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】主机管理" ], "summary": "删除宿主机", "parameters": [ { "type": "string", "description": "宿主机ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/images": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "获取当前登录用户的所有镜像配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】镜像管理" ], "summary": "获取当前用户的镜像配置列表", "parameters": [ { "type": "string", "name": "cursor", "in": "query" }, { "type": "integer", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ListImageResp" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "post": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "为当前用户创建新的镜像配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】镜像管理" ], "summary": "创建镜像配置", "parameters": [ { "description": "创建镜像配置请求", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.CreateImageReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.Image" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/images/{id}": { "put": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "更新指定的镜像配置信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】镜像管理" ], "summary": "更新镜像配置", "parameters": [ { "type": "string", "description": "镜像配置ID", "name": "id", "in": "path", "required": true }, { "description": "更新镜像配置请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateImageReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.Image" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "404": { "description": "资源不存在", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "delete": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "删除指定的镜像配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】镜像管理" ], "summary": "删除镜像配置", "parameters": [ { "type": "string", "description": "镜像配置ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.DeleteImageReq" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "404": { "description": "资源不存在", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/logout": { "post": { "description": "清除用户会话,登出系统", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】认证" ], "summary": "用户登出", "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/users/mcp/tools/{id}": { "put": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "更新当前登录用户指定 MCP Tool 的启用状态", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】MCP 配置" ], "summary": "更新当前用户的 MCP Tool 开关配置", "parameters": [ { "type": "string", "description": "MCP Tool ID", "name": "id", "in": "path", "required": true }, { "description": "更新 MCP Tool 开关请求", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateUserMCPToolSettingReq" } } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "404": { "description": "资源不存在", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/mcp/upstreams": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "获取当前登录用户可管理的 MCP Upstream 列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】MCP 配置" ], "summary": "获取当前用户的 MCP Upstream 列表", "parameters": [ { "type": "string", "name": "cursor", "in": "query" }, { "type": "integer", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ListUserMCPUpstreamsResp" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "post": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "为当前登录用户创建自定义 MCP Upstream", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】MCP 配置" ], "summary": "创建当前用户的 MCP Upstream", "parameters": [ { "description": "创建 MCP Upstream 请求", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.CreateUserMCPUpstreamReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.MCPUpstream" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/mcp/upstreams/{id}": { "put": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "更新当前登录用户指定的 MCP Upstream 配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】MCP 配置" ], "summary": "更新当前用户的 MCP Upstream", "parameters": [ { "type": "string", "description": "MCP Upstream ID", "name": "id", "in": "path", "required": true }, { "description": "更新 MCP Upstream 请求", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateUserMCPUpstreamReq" } } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "404": { "description": "资源不存在", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "delete": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "删除当前登录用户指定的 MCP Upstream", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】MCP 配置" ], "summary": "删除当前用户的 MCP Upstream", "parameters": [ { "type": "string", "description": "MCP Upstream ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "404": { "description": "资源不存在", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/mcp/upstreams/{id}/sync": { "post": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "触发当前登录用户指定 MCP Upstream 的工具同步", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】MCP 配置" ], "summary": "同步当前用户的 MCP Upstream", "parameters": [ { "type": "string", "description": "MCP Upstream ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "404": { "description": "资源不存在", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/members": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "获取当前用户所在团队的普通成员列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】用户" ], "summary": "获取团队成员列表", "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/domain.User" } } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/models": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "获取当前登录用户的所有模型配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】模型管理" ], "summary": "获取当前用户的模型配置列表", "parameters": [ { "type": "string", "name": "cursor", "in": "query" }, { "type": "integer", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ListModelResp" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "post": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "为当前用户创建新的模型配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】模型管理" ], "summary": "创建模型配置", "parameters": [ { "description": "创建模型配置请求", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.CreateModelReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.Model" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/models/health-check": { "post": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "使用提供的配置进行健康检查,不更新数据库", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】模型管理" ], "summary": "检查模型健康状态(通过配置)", "parameters": [ { "description": "检查模型配置请求", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.CheckByConfigReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.CheckModelResp" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/models/providers": { "get": { "description": "获取供应商支持的模型列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】模型管理" ], "summary": "获取供应商支持的模型列表", "operationId": "get-provider-model-list", "parameters": [ { "type": "string", "name": "api_header", "in": "query" }, { "type": "string", "name": "api_key", "in": "query", "required": true }, { "type": "string", "name": "base_url", "in": "query", "required": true }, { "enum": [ "SiliconFlow", "OpenAI", "Ollama", "DeepSeek", "Moonshot", "AzureOpenAI", "BaiZhiCloud", "Hunyuan", "BaiLian", "Volcengine", "Gemini" ], "type": "string", "x-enum-varnames": [ "ModelProviderSiliconFlow", "ModelProviderOpenAI", "ModelProviderOllama", "ModelProviderDeepSeek", "ModelProviderMoonshot", "ModelProviderAzureOpenAI", "ModelProviderBaiZhiCloud", "ModelProviderHunyuan", "ModelProviderBaiLian", "ModelProviderVolcengine", "ModelProviderGoogle" ], "name": "provider", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.GetProviderModelListResp" } } } ] } } } } }, "/api/v1/users/models/{id}": { "put": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "更新指定的模型配置信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】模型管理" ], "summary": "更新模型配置", "parameters": [ { "type": "string", "description": "模型配置ID", "name": "id", "in": "path", "required": true }, { "description": "更新模型配置请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateModelReq" } } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "404": { "description": "资源不存在", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "delete": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "删除指定的模型配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】模型管理" ], "summary": "删除模型配置", "parameters": [ { "type": "string", "description": "模型配置ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "404": { "description": "资源不存在", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/models/{id}/health-check": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "对指定模型进行健康检查,并更新检查结果到数据库", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】模型管理" ], "summary": "检查模型健康状态(通过ID)", "parameters": [ { "type": "string", "description": "模型配置ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.CheckModelResp" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "404": { "description": "资源不存在", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/notify/channels": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "列出当前用户的所有推送渠道及其订阅配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "通知推送" ], "summary": "列出用户推送渠道", "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/domain.NotifyChannel" } } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "post": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "创建用户推送渠道(钉钉/飞书/企业微信/Webhook),同时配置订阅的事件类型", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "通知推送" ], "summary": "创建用户推送渠道", "parameters": [ { "description": "渠道参数", "name": "param", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.CreateNotifyChannelReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.NotifyChannel" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/notify/channels/{id}": { "put": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "更新用户推送渠道配置及订阅的事件类型", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "通知推送" ], "summary": "更新用户推送渠道", "parameters": [ { "type": "string", "description": "渠道ID", "name": "id", "in": "path", "required": true }, { "description": "更新参数", "name": "param", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateNotifyChannelReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.NotifyChannel" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "delete": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "删除用户推送渠道及其关联的订阅", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "通知推送" ], "summary": "删除用户推送渠道", "parameters": [ { "type": "string", "description": "渠道ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/notify/channels/{id}/test": { "post": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "发送测试消息验证渠道配置是否正确", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "通知推送" ], "summary": "测试用户推送渠道", "parameters": [ { "type": "string", "description": "渠道ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/notify/event-types": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "列出所有支持订阅的事件类型", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "通知推送" ], "summary": "列出事件类型", "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/consts.NotifyEventTypeInfo" } } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/oauth/{provider}/login": { "get": { "description": "根据 provider 生成第三方授权地址。provider 仅支持 google、github。redirect_url 可选,必须是站内相对路径;登录成功后后端会跳转到该路径,空值默认 /console/。", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】OAuth" ], "summary": "发起 Google/GitHub OAuth 登录", "parameters": [ { "type": "string", "description": "登录提供方,仅支持 google、github", "name": "provider", "in": "path", "required": true }, { "type": "string", "description": "登录成功后的站内跳转路径,例如 /console/tasks;只允许站内相对路径", "name": "redirect_url", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.OAuthLoginResp" } } } ] } }, "400": { "description": "provider 或 redirect_url 无效", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/ohmyagent/api-keys": { "post": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "创建当前用户的模型无关 OhMyAgent 代理 Key。请求无需模型参数;使用时在 LLM 请求的 model 字段传模型配置 ID。API Key 与签名 Secret 仅在创建响应中返回。", "produces": [ "application/json" ], "tags": [ "【用户】OhMyAgent" ], "summary": "创建 OhMyAgent API Key", "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.CreateOhMyAgentAPIKeyResp" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/ohmyagent/api-keys/{id}": { "delete": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "按 Key ID 删除当前用户自己的 OhMyAgent 代理 Key;不能删除 runtime Key 或其他用户的 Key。", "produces": [ "application/json" ], "tags": [ "【用户】OhMyAgent" ], "summary": "删除 OhMyAgent API Key", "parameters": [ { "type": "string", "description": "创建接口返回的 Key ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/oidc/callback": { "get": { "description": "处理身份源回调并创建 MonkeyCode 登录会话", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】企业团队成员认证" ], "summary": "处理团队 OIDC 回调", "parameters": [ { "type": "string", "description": "授权码", "name": "code", "in": "query", "required": true }, { "type": "string", "description": "状态", "name": "state", "in": "query", "required": true } ], "responses": {} } }, "/api/v1/users/oidc/default-team": { "get": { "description": "用于私有化登录页展示第一个已启用团队的企业登录入口", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】企业团队成员认证" ], "summary": "获取默认团队公开 OIDC 登录配置", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamOIDCPublicConfigResp" } } } ] } } } } }, "/api/v1/users/oidc/login": { "get": { "description": "根据 team_id 跳转到团队 OIDC 身份源", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】企业团队成员认证" ], "summary": "发起团队 OIDC 登录", "parameters": [ { "type": "string", "description": "团队 ID", "name": "team_id", "in": "query", "required": true } ], "responses": {} } }, "/api/v1/users/oidc/teams/{team_id}": { "get": { "description": "用于团队专属登录页展示企业登录入口", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】企业团队成员认证" ], "summary": "获取团队公开 OIDC 登录配置", "parameters": [ { "type": "string", "description": "团队 ID", "name": "team_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamOIDCPublicConfigResp" } } } ] } } } } }, "/api/v1/users/password-login": { "post": { "description": "密码登录", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】企业团队成员认证" ], "summary": "密码登录", "parameters": [ { "description": "登录请求", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.TeamLoginReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/domain.TeamUserInfo" } } } } }, "/api/v1/users/passwords/accounts/{token}": { "get": { "description": "通过传入的 token 查询账户信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】密码管理" ], "summary": "通过 token 查询账户信息", "parameters": [ { "type": "string", "description": "用户 token", "name": "token", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamUserInfo" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权,token 无效或已过期", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/passwords/change": { "put": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "修改当前用户的密码", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】认证" ], "summary": "修改密码", "parameters": [ { "description": "修改密码请求", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.ChangePasswordReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/passwords/reset": { "put": { "description": "重置当前用户的密码", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】密码管理" ], "summary": "重置密码", "parameters": [ { "description": "重置密码请求", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.ResetUserPasswordReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/passwords/reset-request": { "put": { "description": "重置指定用户的密码,并发送重置邮件", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】密码管理" ], "summary": "发送重置密码邮件", "parameters": [ { "description": "重置密码请求", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.ResetUserPasswordEmailReq" } } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/projects": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "项目列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】项目管理" ], "summary": "项目列表", "parameters": [ { "type": "string", "name": "cursor", "in": "query" }, { "type": "integer", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ListProjectResp" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "post": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "创建项目", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】项目管理" ], "summary": "创建项目", "parameters": [ { "description": "请求参数", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.CreateProjectReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.Project" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/projects/{id}": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "项目详情", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】项目管理" ], "summary": "项目详情", "parameters": [ { "type": "string", "description": "项目ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.Project" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "put": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "更新项目", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】项目管理" ], "summary": "更新项目", "parameters": [ { "type": "string", "description": "项目ID", "name": "id", "in": "path", "required": true }, { "description": "请求参数", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateProjectReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.Project" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "delete": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "删除项目", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】项目管理" ], "summary": "删除项目", "parameters": [ { "type": "string", "description": "项目ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/projects/{id}/collaborators": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "协作者列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】项目管理" ], "summary": "协作者列表", "parameters": [ { "type": "string", "description": "项目ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ListCollaboratorsResp" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/projects/{id}/issues": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "问题列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】项目管理" ], "summary": "问题列表", "parameters": [ { "type": "string", "description": "项目ID", "name": "id", "in": "path", "required": true }, { "type": "string", "name": "cursor", "in": "query" }, { "type": "integer", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ListIssuesResp" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "post": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "创建问题", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】项目管理" ], "summary": "创建问题", "parameters": [ { "type": "string", "description": "项目ID", "name": "id", "in": "path", "required": true }, { "description": "请求参数", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.CreateIssueReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ProjectIssue" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/projects/{id}/issues/{issue_id}": { "put": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "更新问题", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】项目管理" ], "summary": "更新问题", "parameters": [ { "type": "string", "description": "项目ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "问题ID", "name": "issue_id", "in": "path", "required": true }, { "description": "请求参数", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateIssueReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ProjectIssue" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "delete": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "删除问题", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】项目管理" ], "summary": "删除问题", "parameters": [ { "type": "string", "description": "项目ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "问题ID", "name": "issue_id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/projects/{id}/issues/{issue_id}/comments": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "问题评论列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】项目管理" ], "summary": "问题评论列表", "parameters": [ { "type": "string", "description": "项目ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "问题ID", "name": "issue_id", "in": "path", "required": true }, { "type": "string", "name": "cursor", "in": "query" }, { "type": "integer", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ListIssueCommentsResp" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "post": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "创建问题评论", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】项目管理" ], "summary": "创建问题评论", "parameters": [ { "type": "string", "description": "项目ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "问题ID", "name": "issue_id", "in": "path", "required": true }, { "description": "请求参数", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.CreateIssueCommentReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ProjectIssueComment" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/projects/{id}/tree": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "获取项目仓库树", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】项目管理" ], "summary": "获取项目仓库树", "parameters": [ { "type": "string", "description": "项目ID", "name": "id", "in": "path", "required": true }, { "type": "boolean", "description": "是否递归", "name": "recursive", "in": "query" }, { "type": "string", "description": "分支", "name": "ref", "in": "query" }, { "type": "string", "description": "路径", "name": "path", "in": "query" } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/domain.ProjectTreeEntry" } } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/projects/{id}/tree/archive": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "获取项目仓库压缩包", "consumes": [ "application/json" ], "produces": [ "application/zip" ], "tags": [ "【用户】项目管理" ], "summary": "获取项目仓库压缩包", "parameters": [ { "type": "string", "description": "项目ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "分支", "name": "ref", "in": "query" } ], "responses": { "200": { "description": "成功", "schema": { "type": "file" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/projects/{id}/tree/blob": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "获取项目文件内容", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】项目管理" ], "summary": "获取项目文件内容", "parameters": [ { "type": "string", "description": "项目ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "文件路径", "name": "path", "in": "query", "required": true }, { "type": "string", "description": "分支", "name": "ref", "in": "query" } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ProjectBlob" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/projects/{id}/tree/logs": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "获取项目仓库日志", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】项目管理" ], "summary": "获取项目仓库日志", "parameters": [ { "type": "string", "description": "项目ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "分支", "name": "ref", "in": "query" }, { "type": "string", "description": "路径", "name": "path", "in": "query" }, { "type": "integer", "description": "限制数量", "name": "limit", "in": "query" }, { "type": "integer", "description": "偏移量", "name": "offset", "in": "query" }, { "type": "string", "description": "起始 SHA", "name": "since_sha", "in": "query" }, { "type": "string", "description": "结束 SHA", "name": "until_sha", "in": "query" } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ProjectLogs" } } } ] } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/status": { "get": { "description": "检查当前用户是否已登录,返回认证状态和用户信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】认证" ], "summary": "检查用户登录状态", "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamUserInfo" } } } ] } } } } }, "/api/v1/users/subscription": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "开源版固定返回基础订阅状态", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】会员" ], "summary": "查询当前会员状态", "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.SubscriptionResp" } } } ] } }, "401": { "description": "未授权,用户未登录", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/tasks": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "获取属于该用户的所有任务,仅支持普通分页", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】任务管理" ], "summary": "任务列表", "parameters": [ { "type": "string", "description": "下一页标识", "name": "next_token", "in": "query" }, { "type": "integer", "description": "分页", "name": "page", "in": "query" }, { "type": "string", "name": "project_id", "in": "query" }, { "type": "boolean", "name": "quick_start", "in": "query" }, { "type": "integer", "description": "每页多少条记录", "name": "size", "in": "query" }, { "type": "string", "description": "状态筛选,多值用逗号分开 pending,processing,error,finished", "name": "status", "in": "query" } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ListTaskResp" } } } ] } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "post": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "创建任务\n`attachments` 为可选附件列表,最多 10 个;每项包含 `url` 和 `filename`,URL 需要匹配后端配置的附件白名单前缀。创建任务后,首轮 user-input 日志会按 `{ \"content\": \"base64文本\", \"attachments\": [] }` 结构返回。", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】任务管理" ], "summary": "创建任务", "parameters": [ { "description": "请求参数", "name": "param", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.CreateTaskReq" } } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ProjectTask" } } } ] } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/tasks/control": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "数据格式约定:当前仅支持文本帧透传。服务端将 Agent 的原始文本数据包装为如下结构返回给前端(对应 domain.TaskStream):\n```json\n{ \"type\": \"string\", \"data\": \"string\", \"kind\": \"string\", \"timestamp\": 0 }\n```\n独立于 stream 的长生命周期 WebSocket 连接,用于处理 call/call-response(文件浏览、diff 查看等同步请求)。\ntask 结束后连接不断开,仍可用于文件操作。\n支持同一 taskID 多 tab 并发连接。\n\n## 上行消息\n\n### Type=call, Kind=repo_file_diff — 获取文件 diff\n请求 Data:\n```json\n{\"request_id\":\"string\",\"path\":\"string\",\"unified\":true,\"context_lines\":3}\n```\n响应 Data:\n```json\n{\"request_id\":\"string\",\"path\":\"string\",\"diff\":\"string\",\"success\":true,\"error\":\"string?\"}\n```\n\n### Type=call, Kind=repo_file_list — 列出目录文件\n请求 Data:\n```json\n{\"request_id\":\"string\",\"path\":\"string\",\"glob_pattern\":\"string?\",\"include_hidden\":false}\n```\n响应 Data:\n```json\n{\"request_id\":\"string\",\"path\":\"string\",\"files\":[{\"name\":\"string\",\"path\":\"string\",\"entry_mode\":0,\"size\":0,\"modified_at\":0}],\"success\":true,\"error\":\"string?\"}\n```\n\n### Type=call, Kind=repo_read_file — 读取文件内容\n请求 Data:\n```json\n{\"request_id\":\"string\",\"path\":\"string\",\"offset\":0,\"length\":0}\n```\n响应 Data:\n```json\n{\"request_id\":\"string\",\"path\":\"string\",\"content\":\"bytes\",\"total_size\":0,\"offset\":0,\"length\":0,\"is_truncated\":false,\"success\":true,\"error\":\"string?\"}\n```\n\n### Type=call, Kind=repo_file_changes — 查询变更文件列表\n请求 Data:\n```json\n{\"request_id\":\"string\"}\n```\n响应 Data:\n```json\n{\"request_id\":\"string\",\"changes\":[{\"path\":\"string\",\"status\":\"string\",\"additions\":0,\"deletions\":0,\"old_path\":\"string?\"}],\"branch\":\"string?\",\"commit_hash\":\"string?\",\"success\":true,\"error\":\"string?\"}\n```\n\n### Type=call, Kind=port_forward_list — 获取端口转发列表\n请求 Data:\n```json\n{\"request_id\":\"string\"}\n```\n响应 Data:\n```json\n{\"request_id\":\"string\",\"ports\":[{\"port\":0,\"status\":\"string\",\"process\":\"string\",\"forward_id\":\"string?\",\"access_url\":\"string?\",\"label\":\"string?\",\"error_message\":\"string?\",\"whitelist_ips\":[\"string\"]}]}\n```\n\n### Type=call, Kind=restart — 重启任务\n请求 Data:\n```json\n{\"request_id\":\"string\",\"load_session\":true}\n```\n响应 Data:\n```json\n{\"id\":\"uuid\",\"request_id\":\"string?\",\"success\":true,\"message\":\"string\",\"session_id\":\"string\"}\n```\n\n### Type=call, Kind=switch_model — 切换运行中任务模型\n请求 Data:\n```json\n{\"request_id\":\"string\",\"model_id\":\"uuid\",\"load_session\":true}\n```\n响应 Data:\n```json\n{\"id\":\"uuid\",\"request_id\":\"string?\",\"success\":true,\"message\":\"string\",\"session_id\":\"string\",\"model\":{}}\n```\n\n### Type=call, Kind=switch_agent_resources — 运行中更新任务 skill/plugin 列表\n请求 Data (全量声明当前所选,非增量):\n```json\n{\"request_id\":\"string\",\"skill_ids\":[\"uuid\"],\"plugin_ids\":[\"uuid\"]}\n```\n响应 Data:\n```json\n{\"request_id\":\"string\",\"success\":true,\"message\":\"string\",\"session_id\":\"string\"}\n```\n\n### Type=sync-my-ip — 同步 Web 客户端真实 IP\n请求 Data:\n```json\n{\"client_ip\":\"string\"}\n```\n\n## 下行消息\n\n- Type=call-response: 同步请求响应(Kind 与请求一致)。失败时 Data 为:\n```json\n{\"request_id\":\"string\",\"success\":false,\"error\":\"string\"}\n```\n- Type=task-event: 任务事件(从 TaskLive 订阅转发)\n- Type=ping: 心跳(无 Data)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】任务管理" ], "summary": "任务控制流 WebSocket", "parameters": [ { "type": "string", "description": "任务 ID", "name": "id", "in": "query", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/tasks/public-stream": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "数据格式约定参考任务数据流 WebSocket 接口", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】任务管理" ], "summary": "公开的任务数据流 WebSocket", "parameters": [ { "type": "string", "description": "任务 ID", "name": "id", "in": "query", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/tasks/rounds": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "根据 cursor 翻页查询任务的历史轮次。limit 为轮次数(非条目数),\nlimit=2 表示返回 2 轮的完整消息。direction=backward(默认)从 cursor 往更早翻,轮间倒序(最新轮在前);\ndirection=forward 往更新翻,轮间正序(最旧轮在前);轮内消息始终按时间正序。\n即响应中最后一轮总是与 next_cursor 相邻的那一轮。前端应以每条 chunk 的 seq 做分组排序,不依赖数组顺序。\n日志存储为 ClickHouse 时 cursor 即轮次号 seq,可配合 inclusive=true 实现\"跳转到第 seq 轮\";\nLoki 仅支持 backward 且不支持 inclusive,违反时返回 err-task-rounds-direction-unsupported。\n返回的 user-input.data 统一为 JSON payload 字符串,例如 `{\"content\":\"57un57ut5aSE55CG\",\"attachments\":[]}`;content 为用户输入文本的 base64 编码,旧历史裸文本也会按该结构包装返回。", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】任务管理" ], "summary": "查询任务历史轮次", "parameters": [ { "type": "string", "description": "任务 ID", "name": "id", "in": "query", "required": true }, { "type": "string", "description": "分页游标(ClickHouse 下即轮次号 seq)", "name": "cursor", "in": "query" }, { "type": "integer", "description": "轮次数(默认 2,上限 10)", "name": "limit", "in": "query" }, { "type": "string", "description": "翻页方向:backward(默认)/ forward", "name": "direction", "in": "query" }, { "type": "boolean", "description": "是否包含 cursor 指向的那一轮(跳转定位用)", "name": "inclusive", "in": "query" } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TaskRoundsResp" } } } ] } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/tasks/speech-to-text": { "post": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "上传音频数据进行语音识别,返回Server-Sent Events流式文字结果。响应格式为SSE,每个事件包含event和data字段。", "consumes": [ "application/octet-stream" ], "produces": [ "text/event-stream" ], "tags": [ "【用户】任务管理" ], "summary": "语音转文字", "responses": { "200": { "description": "Server-Sent Events流,包含recognition(识别结果)、end(结束)和error(错误)事件", "schema": { "$ref": "#/definitions/domain.SpeechRecognitionEvent" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/tasks/speech-to-text-stream": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "通过 WebSocket 上传实时音频流并实时返回识别结果。\n后端使用豆包流式语音识别 2.0 (bigmodel_async)。完整协议见 docs/speech-to-text-stream.md。\n\n## 帧类型约定\n| 方向 | 帧类型 | 用途 |\n|---|---|---|\n| C → S | Text(JSON) | 控制消息:start / stop |\n| C → S | Binary | 音频字节流,服务端封装为豆包帧透传 |\n| S → C | Text(JSON) | 所有事件(ready / partial / final / done / error) |\n\n## 客户端 → 服务端\n\n### 1) start (第一帧必须是它)\n```json\n{\n\"type\": \"start\",\n\"format\": \"pcm\",\n\"disfluency\": false\n}\n```\n- `format` 可选,默认 `pcm`。支持 `pcm` / `wav` / `ogg` / `mp3`,单声道、16-bit、采样率固定 16000Hz\n- `pcm` / `wav` 内部音频流必须是 `pcm_s16le`;`ogg` 必须为 `opus` 编码;`mp3` 由远端解码\n- `disfluency` 可选,默认 `false`。`true` 时启用语义顺滑(过滤\"嗯/啊\"等口头禅、语义重复词)\n- 服务端校验通过 → 与豆包建立 WSS → 收到首个响应后向客户端下发 `ready` 事件(带 `logid`)\n- **客户端必须在收到 `ready` 之后才能发 Binary 音频帧**\n- 以下能力默认开启:中间结果(双向流式天然有)、标点预测、ITN(中文数字转阿拉伯数字)\n\n### 2) Binary 音频帧\n`ready` 之后,客户端持续发 Binary 帧。**建议每帧 200ms**(豆包推荐值,过碎会影响性能)。\n\n### 3) stop (主动结束)\n```json\n{ \"type\": \"stop\" }\n```\n服务端收到后向豆包发送\"最后一包\"标志,等待豆包最终响应后下发 `done` 事件并关闭 WS。客户端直接 close WS 亦可。\n\n## 服务端 → 客户端\n\n所有事件统一外层结构:\n```json\n{ \"type\": \"\u003cevent_type\u003e\", \"timestamp\": 1733299200000, ... }\n```\n\n### ready — 远端已就绪\n```json\n{ \"type\": \"ready\", \"logid\": \"202407261553070FACFE6D19421815D605\", \"timestamp\": 1733299200000 }\n```\n仅推送一次。客户端收到后开始发 Binary 音频帧。`logid` 是豆包返回的 `X-Tt-Logid`,排障必备,\n建议前端在 session 期间一直打印它,跟后续 error 事件可以关联。\n\n### partial — 中间结果(实时滚动,会反复推送)\n```json\n{ \"type\": \"partial\", \"index\": 1, \"text\": \"今天天气真\", \"timestamp\": 1733299201500 }\n```\n- 同一 `index` 的 `partial` 会反复推送,`text` 通常逐渐变长\n- **客户端必须用 `text` 覆盖该句显示内容,不要追加**\n\n### final — 一句话定稿\n```json\n{ \"type\": \"final\", \"index\": 1, \"text\": \"今天天气真不错。\", \"timestamp\": 1733299202800 }\n```\n- 该句识别完成、内容固化,后续不会再变;客户端用 `text` 覆盖 `index` 对应位置\n- `final` 之后可能立刻有下一句的 `partial`(`index+1`)\n\n### done — 整个 session 结束\n```json\n{ \"type\": \"done\", \"logid\": \"...\", \"timestamp\": 1733299210000 }\n```\n- 服务端已收到豆包最后一包响应、释放资源,即将关闭 WS;`done` 之后不会再有任何事件\n\n### error — 错误\n豆包远端错误:\n```json\n{\n\"type\": \"error\",\n\"logid\": \"202407261553070FACFE6D19421815D605\",\n\"error\": {\n\"code\": 45000001,\n\"message\": \"请求参数无效\",\n\"request_id\": \"67ee89ba-7050-4c04-a3d7-ac61a63499b3\",\n\"logid\": \"202407261553070FACFE6D19421815D605\"\n},\n\"timestamp\": 1733299205000\n}\n```\n本服务前置校验错误(远端连接前):`code=0`,在 `message` 描述原因:\n```json\n{\n\"type\": \"error\",\n\"error\": { \"code\": 0, \"message\": \"first message must be a 'start' control message\" },\n\"timestamp\": 1733299205000\n}\n```\n\n## 豆包常见错误码速查\n| code | 含义 | 典型原因 |\n|---|---|---|\n| `45000001` | 请求参数无效 | 缺字段 / 字段值无效 / 重复请求 |\n| `45000002` | 空音频 | 录音未采集到声音 |\n| `45000081` | 等包超时 | 前端没在期限内连续发送音频帧 |\n| `45000151` | 音频格式不正确 | `format` 与实际音频不匹配 |\n| `55000031` | 服务器繁忙 | 退避重试 |\n| `550xxxxx` | 服务内部错误 | 直接重试,持续失败时带 `logid` 联系运维 |\n\n## 时序示例\n```\nC → S: WS upgrade (带鉴权)\nC → S: {\"type\":\"start\",\"format\":\"pcm\"}\nS → C: {\"type\":\"ready\",\"logid\":\"...\"}\nC → S: \u003cbinary 200ms\u003e \u003cbinary 200ms\u003e ...\nS → C: {\"type\":\"partial\",\"index\":1,\"text\":\"今天\"}\nS → C: {\"type\":\"partial\",\"index\":1,\"text\":\"今天天气真\"}\nS → C: {\"type\":\"final\",\"index\":1,\"text\":\"今天天气真不错。\"}\nC → S: {\"type\":\"stop\"}\nS → C: {\"type\":\"done\",\"logid\":\"...\"}\nWS close\n```\n\n## 与 POST /speech-to-text 的差异\n- POST /speech-to-text:整段录音 → SSE 单段结果,适合短语音 ≤60s\n- 本接口:WS 双向实时流,支持长语音、句级 final、可被打断,适合 Web/移动端边说边显示\n", "tags": [ "【用户】任务管理" ], "summary": "实时语音转写(WebSocket 流式)", "parameters": [ { "description": "[WS 协议] 客户端连接后首帧 JSON Text 控制消息 schema;不是 HTTP body,仅供前端代码生成 TS 类型,实际通过 WS Text 帧发送", "name": "start", "in": "body", "schema": { "$ref": "#/definitions/domain.SpeechStreamStartReq" } } ], "responses": { "101": { "description": "WebSocket 升级成功;此后通过 WS 帧通信,事件结构见上方说明", "schema": { "$ref": "#/definitions/domain.SpeechStreamEvent" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误(ASR 服务未配置等)", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/tasks/stop": { "put": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "停止任务", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】任务管理" ], "summary": "停止任务", "parameters": [ { "description": "任务 id", "name": "id", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.IDReq-github_com_google_uuid_UUID" } } ], "responses": { "200": { "description": "成功回包", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/tasks/stream": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "功能定位:该接口通过 WebSocket 转发任务运行数据。任务对话继续输入使用 `type=user-input`。\n数据格式约定:当前仅支持文本帧透传。服务端将 Agent 的原始文本数据包装为如下结构返回给前端(对应 domain.TaskStream):\n```json\n{ \"type\": \"string\", \"data\": \"string\", \"kind\": \"string\", \"timestamp\": 0 }\n```\nuser-input 上行新格式:\n```json\n{ \"type\": \"user-input\", \"data\": \"{\\\"content\\\":\\\"57un57ut5aSE55CG6L+Z5Liq6Zeu6aKY\\\",\\\"attachments\\\":[{\\\"url\\\":\\\"https://example-bucket.oss-cn-hangzhou.aliyuncs.com/temp/a.txt\\\",\\\"filename\\\":\\\"a.txt\\\"}]}\" }\n```\nuser-input 上行旧格式仍兼容:\n```json\n{ \"type\": \"user-input\", \"data\": \"继续处理这个问题\" }\n```\nuser-input 下行和历史返回统一使用新 JSON payload 字符串:\n```json\n{ \"type\": \"user-input\", \"data\": \"{\\\"content\\\":\\\"57un57ut5aSE55CG6L+Z5Liq6Zeu6aKY\\\",\\\"attachments\\\":[]}\", \"timestamp\": 0 }\n```\n`attachments` 为可选附件列表,最多 10 个;每项包含 `url` 和 `filename`,URL 需要匹配后端配置的附件白名单前缀。\ntype 字段说明:\n- task-started: 本轮任务启动\n- task-ended: 本轮任务结束\n- task-error: 本轮任务发生错误\n- task-running: 任务正在运行\n- task-event: 任务临时事件, 不持久化\n- file-change: 文件变动事件\n- permission-resp: 用户的权限响应\n- auto-approve: 开启自动批准\n- disable-auto-approve: 关闭自动批准\n- user-input: 用户输入\n- user-cancel: 取消当前操作,不会终止任务\n- reply-question: 回复 AI 的提问\n- cursor: 历史游标,用于通过 /rounds 接口加载更早的轮次\n\ncursor 消息结构:\n```json\n{ \"type\": \"cursor\", \"data\": { \"cursor\": \"\u003cnextCursor\u003e\", \"has_more\": true }, \"timestamp\": 0 }\n```\n- cursor: 当前分页游标,作为 GET /rounds 接口的 cursor 参数向前翻页\n- has_more: 是否存在更早的轮次。为 false 时表示当前轮次即为第一轮,无需再翻页", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】任务管理" ], "summary": "任务数据流 WebSocket", "parameters": [ { "type": "string", "description": "任务 ID", "name": "id", "in": "query", "required": true }, { "type": "string", "description": "模式:new(等待用户输入)|attach(仅拉取当前轮次),默认 new", "name": "mode", "in": "query" } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/tasks/user-inputs": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "查询任务的 user-input 消息(倒序,最新在前),根据 cursor 向更早翻页,用于聊天页侧边栏快速跳转到指定一轮对话。\n单条返回的 id 形如 `user-input-{timestamp_ns}`,与前端聊天页消息列表中的 `data-message-id` 对齐。\ncontent 已解码为明文,超出 500 字符会截断并将 truncated 置为 true。\n日志存储为 ClickHouse 时每条带 seq(轮次号),可作为 /rounds 接口的 cursor 配合 inclusive=true 跳转定位;Loki 下无 seq。", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】任务管理" ], "summary": "查询任务用户输入列表", "parameters": [ { "type": "string", "description": "任务 ID", "name": "id", "in": "query", "required": true }, { "type": "string", "description": "分页游标,第一页留空", "name": "cursor", "in": "query" }, { "type": "integer", "description": "返回条数(默认 20,上限 100)", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TaskUserInputsResp" } } } ] } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/tasks/{id}": { "get": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "任务详情", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】任务管理" ], "summary": "任务详情", "parameters": [ { "type": "string", "description": "任务 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.Task" } } } ] } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "put": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "更新任务信息(如标题)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】任务管理" ], "summary": "更新任务", "parameters": [ { "type": "string", "description": "任务 ID", "name": "id", "in": "path", "required": true }, { "description": "请求参数", "name": "param", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateTaskReq" } } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } }, "delete": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "删除任务。任务处于运行中(pending/processing)或虚拟机仍在线时不允许删除。", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】任务管理" ], "summary": "删除任务", "parameters": [ { "type": "string", "description": "任务 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/wechat-mp/bind": { "delete": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "解除当前用户与微信公众号 OpenID 的绑定关系", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】微信公众号推送" ], "summary": "解除公众号绑定", "responses": { "200": { "description": "成功", "schema": { "$ref": "#/definitions/web.Resp" } }, "401": { "description": "未授权,用户未登录", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } }, "/api/v1/users/wechat-mp/bind-qrcode": { "post": { "security": [ { "MonkeyCodeAIAuth": [] } ], "description": "为当前登录用户创建微信公众号绑定临时二维码,用户扫码关注/扫码后完成绑定", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "【用户】微信公众号推送" ], "summary": "创建公众号绑定二维码", "responses": { "200": { "description": "成功", "schema": { "allOf": [ { "$ref": "#/definitions/web.Resp" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.BindQRCodeResp" } } } ] } }, "401": { "description": "未授权,用户未登录", "schema": { "$ref": "#/definitions/web.Resp" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/web.Resp" } } } } } }, "definitions": { "consts.CliName": { "type": "string", "enum": [ "codex", "claude", "opencode" ], "x-enum-varnames": [ "CliNameCodex", "CliNameClaude", "CliNameOpencode" ] }, "consts.GitPlatform": { "type": "string", "enum": [ "github", "gitlab", "gitea", "gitee", "codeup", "cnb", "atomgit" ], "x-enum-varnames": [ "GitPlatformGithub", "GitPlatformGitLab", "GitPlatformGitea", "GitPlatformGitee", "GitPlatformCodeup", "GitPlatformCnb", "GitPlatformAtomgit" ] }, "consts.HostStatus": { "type": "string", "enum": [ "online", "offline" ], "x-enum-varnames": [ "HostStatusOnline", "HostStatusOffline" ] }, "consts.InterfaceType": { "type": "string", "enum": [ "openai_chat", "openai_responses", "anthropic" ], "x-enum-varnames": [ "InterfaceTypeOpenAIChat", "InterfaceTypeOpenAIResponse", "InterfaceTypeAnthropic" ] }, "consts.LogStore": { "type": "string", "enum": [ "loki", "clickhouse" ], "x-enum-varnames": [ "LogStoreLoki", "LogStoreClickHouse" ] }, "consts.ModelProvider": { "type": "string", "enum": [ "SiliconFlow", "OpenAI", "Ollama", "DeepSeek", "Moonshot", "AzureOpenAI", "BaiZhiCloud", "Hunyuan", "BaiLian", "Volcengine", "Gemini" ], "x-enum-varnames": [ "ModelProviderSiliconFlow", "ModelProviderOpenAI", "ModelProviderOllama", "ModelProviderDeepSeek", "ModelProviderMoonshot", "ModelProviderAzureOpenAI", "ModelProviderBaiZhiCloud", "ModelProviderHunyuan", "ModelProviderBaiLian", "ModelProviderVolcengine", "ModelProviderGoogle" ] }, "consts.NotifyChannelKind": { "type": "string", "enum": [ "dingtalk", "feishu", "wecom", "webhook", "wechat_mp" ], "x-enum-varnames": [ "NotifyChannelDingTalk", "NotifyChannelFeishu", "NotifyChannelWeCom", "NotifyChannelWebhook", "NotifyChannelWechatMP" ] }, "consts.NotifyEventType": { "type": "string", "enum": [ "task.created", "task.ended", "vm.expiring_soon", "quota.refreshed", "quota.basic_exhausted", "quota.pro_exhausted", "quota.ultra_exhausted" ], "x-enum-varnames": [ "NotifyEventTaskCreated", "NotifyEventTaskEnded", "NotifyEventVMExpiringSoon", "NotifyEventQuotaRefreshed", "NotifyEventQuotaBasicExhausted", "NotifyEventQuotaProExhausted", "NotifyEventQuotaUltraExhausted" ] }, "consts.NotifyEventTypeInfo": { "type": "object", "properties": { "description": { "type": "string" }, "name": { "type": "string" }, "type": { "$ref": "#/definitions/consts.NotifyEventType" } } }, "consts.NotifyOwnerType": { "type": "string", "enum": [ "user", "team" ], "x-enum-varnames": [ "NotifyOwnerUser", "NotifyOwnerTeam" ] }, "consts.OwnerType": { "type": "string", "enum": [ "private", "public", "team" ], "x-enum-varnames": [ "OwnerTypePrivate", "OwnerTypePublic", "OwnerTypeTeam" ] }, "consts.PortStatus": { "type": "string", "enum": [ "reserved", "connected" ], "x-enum-varnames": [ "PortStatusReversed", "PortStatusConnected" ] }, "consts.ProjectCollaboratorRole": { "type": "string", "enum": [ "read_only", "read_write" ], "x-enum-varnames": [ "ProjectCollaboratorRoleReadOnly", "ProjectCollaboratorRoleReadWrite" ] }, "consts.ProjectIssuePriority": { "type": "integer", "enum": [ 1, 2, 3 ], "x-enum-varnames": [ "ProjectIssuePriorityOne", "ProjectIssuePriorityTwo", "ProjectIssuePriorityThree" ] }, "consts.ProjectIssueStatus": { "type": "string", "enum": [ "open", "closed", "completed" ], "x-enum-varnames": [ "ProjectIssueStatusOpen", "ProjectIssueStatusClosed", "ProjectIssueStatusCompleted" ] }, "consts.TaskStatus": { "type": "string", "enum": [ "pending", "processing", "error", "finished" ], "x-enum-varnames": [ "TaskStatusPending", "TaskStatusProcessing", "TaskStatusError", "TaskStatusFinished" ] }, "consts.TaskSubType": { "type": "string", "enum": [ "generate_docs", "generate_requirement", "generate_design", "generate_tasklist", "execute_task", "pr_review" ], "x-enum-varnames": [ "TaskSubTypeGenerateDocs", "TaskSubTypeGenerateRequirement", "TaskSubTypeGenerateDesign", "TaskSubTypeGenerateTasklist", "TaskSubTypeExecuteTask", "TaskSubTypePrReview" ] }, "consts.TaskType": { "type": "string", "enum": [ "develop", "design", "review" ], "x-enum-varnames": [ "TaskTypeDevelop", "TaskTypeDesign", "TaskTypeReview" ] }, "consts.TeamMemberRole": { "type": "string", "enum": [ "admin", "user" ], "x-enum-varnames": [ "TeamMemberRoleAdmin", "TeamMemberRoleUser" ] }, "consts.TerminalMode": { "type": "string", "enum": [ "read_only", "read_write" ], "x-enum-varnames": [ "TerminalModeReadOnly", "TerminalModeReadWrite" ] }, "consts.UserPlatform": { "type": "string", "enum": [ "baizhi", "google", "github", "gitlab", "gitea", "gitee", "oidc" ], "x-enum-comments": { "UserPlatformBaizhi": "百智云平台" }, "x-enum-varnames": [ "UserPlatformBaizhi", "UserPlatformGoogle", "UserPlatformGithub", "UserPlatformGitLab", "UserPlatformGitea", "UserPlatformGitee", "UserPlatformOIDC" ] }, "consts.UserRole": { "type": "string", "enum": [ "individual", "enterprise", "subaccount", "admin", "gittask" ], "x-enum-comments": { "UserRoleAdmin": "MonkeyCode-AI 管理员账号,用来配置公共资源. 如公共宿主机等", "UserRoleEnterprise": "企业用户", "UserRoleGitTask": "全自动 git 任务插入的用户", "UserRoleIndividual": "个人用户", "UserRoleSubAccount": "企业子账户" }, "x-enum-varnames": [ "UserRoleIndividual", "UserRoleEnterprise", "UserRoleSubAccount", "UserRoleAdmin", "UserRoleGitTask" ] }, "consts.UserStatus": { "type": "string", "enum": [ "active", "inactive", "banded" ], "x-enum-varnames": [ "UserStatusActive", "UserStatusInactive", "UserStatusBanded" ] }, "db.Cursor": { "type": "object", "properties": { "cursor": { "description": "游标", "type": "string" }, "has_next_page": { "description": "是否有下一页", "type": "boolean" } } }, "db.PageInfo": { "type": "object", "properties": { "has_next_page": { "type": "boolean" }, "next_token": { "type": "string" }, "total_count": { "type": "integer" } } }, "domain.AddGitIdentityReq": { "type": "object", "required": [ "access_token", "base_url", "email", "platform", "username" ], "properties": { "access_token": { "type": "string" }, "base_url": { "type": "string" }, "email": { "type": "string" }, "organization_id": { "description": "云效 Codeup 组织 ID,绑定后自动解析填充", "type": "string" }, "platform": { "$ref": "#/definitions/consts.GitPlatform" }, "remark": { "type": "string" }, "username": { "type": "string" } } }, "domain.AddTeamAdminReq": { "type": "object", "required": [ "email", "name" ], "properties": { "email": { "description": "邮箱", "type": "string" }, "name": { "description": "姓名", "type": "string" } } }, "domain.AddTeamAdminResp": { "type": "object", "properties": { "password": { "type": "string" }, "user": { "$ref": "#/definitions/domain.TeamUser" } } }, "domain.AddTeamGroupReq": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string" } } }, "domain.AddTeamGroupUsersReq": { "type": "object", "required": [ "user_ids" ], "properties": { "user_ids": { "type": "array", "items": { "type": "string" } } } }, "domain.AddTeamGroupUsersResp": { "type": "object", "properties": { "users": { "type": "array", "items": { "$ref": "#/definitions/domain.User" } } } }, "domain.AddTeamImageReq": { "type": "object", "required": [ "name" ], "properties": { "group_ids": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "remark": { "type": "string" } } }, "domain.AddTeamModelReq": { "type": "object", "required": [ "api_key", "base_url", "interface_type", "model", "provider" ], "properties": { "api_key": { "type": "string" }, "base_url": { "type": "string" }, "group_ids": { "type": "array", "items": { "type": "string" } }, "interface_type": { "enum": [ "openai_chat", "openai_responses", "anthropic" ], "allOf": [ { "$ref": "#/definitions/consts.InterfaceType" } ] }, "model": { "type": "string" }, "provider": { "type": "string" }, "remark": { "type": "string" }, "support_image": { "type": "boolean" }, "temperature": { "type": "number" } } }, "domain.AddTeamSkillReq": { "type": "object", "required": [ "content", "description", "name" ], "properties": { "content": { "description": "SKILL.md 原文", "type": "string" }, "description": { "type": "string" }, "group_ids": { "type": "array", "items": { "type": "string" } }, "is_force_delivery": { "type": "boolean" }, "name": { "type": "string" }, "skill_md_path": { "type": "string" }, "source_label": { "type": "string" }, "source_type": { "description": "SourceType ∈ {\"zip\",\"markdown\",\"text\"};SourceLabel 为文件名或 \"粘贴文本\"。\n纯展示元数据,存进 active version 的 parsed_meta。", "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } } } }, "domain.AddTeamUserReq": { "type": "object", "required": [ "emails" ], "properties": { "emails": { "description": "邮箱列表", "type": "array", "items": { "type": "string" } }, "group_id": { "description": "团队组ID", "type": "string" } } }, "domain.AddTeamUserResp": { "type": "object", "properties": { "users": { "type": "array", "items": { "$ref": "#/definitions/domain.TeamUser" } } } }, "domain.AddTeamUserWithPasswordResp": { "type": "object", "properties": { "passwords": { "type": "array", "items": { "$ref": "#/definitions/domain.TeamUserPassword" } }, "users": { "type": "array", "items": { "$ref": "#/definitions/domain.TeamUser" } } } }, "domain.ApplyPortReq": { "type": "object", "required": [ "port", "white_list" ], "properties": { "forward_id": { "type": "string" }, "port": { "type": "integer", "maximum": 65535, "minimum": 1 }, "white_list": { "type": "array", "items": { "type": "string" } } } }, "domain.Audit": { "type": "object", "properties": { "created_at": { "type": "string" }, "id": { "type": "string" }, "operation": { "type": "string" }, "request": { "type": "string" }, "response": { "type": "string" }, "source_ip": { "type": "string" }, "user": { "$ref": "#/definitions/domain.User" }, "user_agent": { "type": "string" } } }, "domain.AuthRepository": { "type": "object", "properties": { "description": { "type": "string" }, "full_name": { "type": "string" }, "url": { "type": "string" } } }, "domain.BindQRCodeResp": { "type": "object", "properties": { "expire_seconds": { "type": "integer" }, "qrcode_url": { "type": "string" }, "ticket": { "type": "string" } } }, "domain.Branch": { "type": "object", "properties": { "name": { "type": "string" } } }, "domain.ChangePasswordReq": { "type": "object", "required": [ "new_password" ], "properties": { "current_password": { "description": "当前密码", "type": "string" }, "new_password": { "description": "新密码", "type": "string" } } }, "domain.CheckByConfigReq": { "type": "object", "required": [ "api_key", "base_url", "model", "provider" ], "properties": { "api_key": { "type": "string" }, "base_url": { "type": "string" }, "interface_type": { "enum": [ "openai_chat", "openai_responses", "anthropic" ], "allOf": [ { "$ref": "#/definitions/consts.InterfaceType" } ] }, "model": { "type": "string" }, "provider": { "$ref": "#/definitions/consts.ModelProvider" } } }, "domain.CheckModelResp": { "type": "object", "properties": { "error": { "type": "string" }, "success": { "type": "boolean" } } }, "domain.Collaborator": { "type": "object", "properties": { "avatar_url": { "type": "string" }, "email": { "type": "string" }, "has_password": { "type": "boolean" }, "id": { "type": "string" }, "identities": { "type": "array", "items": { "$ref": "#/definitions/domain.UserIdentity" } }, "is_blocked": { "type": "boolean" }, "name": { "type": "string" }, "permission": { "$ref": "#/definitions/consts.ProjectCollaboratorRole" }, "role": { "$ref": "#/definitions/consts.UserRole" }, "status": { "$ref": "#/definitions/consts.UserStatus" }, "team": { "$ref": "#/definitions/domain.Team" }, "token": { "type": "string" }, "wechat_mp_bound": { "type": "boolean" } } }, "domain.CreateCollaboratorItem": { "type": "object", "properties": { "permission": { "$ref": "#/definitions/consts.ProjectCollaboratorRole" }, "user_id": { "type": "string" } } }, "domain.CreateGitBotReq": { "type": "object", "required": [ "host_id", "platform", "token" ], "properties": { "host_id": { "type": "string" }, "name": { "type": "string" }, "platform": { "$ref": "#/definitions/consts.GitPlatform" }, "token": { "type": "string" } } }, "domain.CreateImageReq": { "type": "object", "required": [ "image_name" ], "properties": { "image_name": { "type": "string" }, "is_default": { "type": "boolean" }, "remark": { "type": "string" } } }, "domain.CreateIssueCommentReq": { "type": "object", "required": [ "comment" ], "properties": { "comment": { "type": "string" }, "parent_id": { "type": "string" } } }, "domain.CreateIssueReq": { "type": "object", "properties": { "assignee_id": { "type": "string" }, "priority": { "$ref": "#/definitions/consts.ProjectIssuePriority" }, "requirement_document": { "type": "string" }, "title": { "type": "string" } } }, "domain.CreateModelReq": { "type": "object", "required": [ "api_key", "base_url", "interface_type", "model", "provider" ], "properties": { "api_key": { "type": "string" }, "base_url": { "type": "string" }, "context_limit": { "type": "integer" }, "interface_type": { "enum": [ "openai_chat", "openai_responses", "anthropic" ], "allOf": [ { "$ref": "#/definitions/consts.InterfaceType" } ] }, "is_default": { "type": "boolean" }, "is_hidden": { "type": "boolean" }, "model": { "type": "string" }, "output_limit": { "type": "integer" }, "provider": { "type": "string" }, "remark": { "type": "string" }, "support_image": { "type": "boolean" }, "temperature": { "type": "number" }, "thinking_enabled": { "type": "boolean" } } }, "domain.CreateNotifyChannelReq": { "type": "object", "required": [ "event_types", "kind", "name", "webhook_url" ], "properties": { "event_types": { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/consts.NotifyEventType" } }, "headers": { "type": "object", "additionalProperties": { "type": "string" } }, "kind": { "enum": [ "dingtalk", "feishu", "wecom", "webhook" ], "allOf": [ { "$ref": "#/definitions/consts.NotifyChannelKind" } ] }, "name": { "type": "string", "maxLength": 64 }, "secret": { "type": "string" }, "webhook_url": { "type": "string" } } }, "domain.CreateOhMyAgentAPIKeyResp": { "type": "object", "properties": { "api_key": { "type": "string" }, "created_at": { "type": "integer" }, "id": { "type": "string" }, "signing_secret": { "type": "string" } } }, "domain.CreateProjectReq": { "type": "object", "properties": { "description": { "type": "string" }, "env_variables": { "type": "object", "additionalProperties": {} }, "git_identity_id": { "type": "string" }, "image_id": { "type": "string" }, "name": { "type": "string" }, "platform": { "$ref": "#/definitions/consts.GitPlatform" }, "repo_url": { "type": "string" } } }, "domain.CreateTaskReq": { "type": "object", "required": [ "content", "host_id", "image_id", "model_id", "repo", "resource" ], "properties": { "attachments": { "description": "附件列表,最多 10 个;URL 必须匹配后端配置的附件白名单前缀", "type": "array", "items": { "$ref": "#/definitions/domain.TaskAttachment" } }, "cli_name": { "$ref": "#/definitions/consts.CliName" }, "content": { "type": "string" }, "extra": { "$ref": "#/definitions/domain.TaskExtraConfig" }, "git_identity_id": { "type": "string" }, "host_id": { "type": "string" }, "image_id": { "type": "string" }, "model_id": { "type": "string" }, "repo": { "$ref": "#/definitions/domain.TaskRepoReq" }, "resource": { "$ref": "#/definitions/domain.VMResource" }, "sub_type": { "$ref": "#/definitions/consts.TaskSubType" }, "system_prompt": { "type": "string" }, "task_type": { "$ref": "#/definitions/consts.TaskType" } } }, "domain.CreateTeamMCPUpstreamReq": { "type": "object", "required": [ "name", "slug", "url" ], "properties": { "description": { "type": "string" }, "enabled": { "type": "boolean" }, "group_ids": { "type": "array", "items": { "type": "string" } }, "headers": { "type": "array", "items": { "$ref": "#/definitions/domain.MCPHeader" } }, "name": { "type": "string" }, "slug": { "type": "string" }, "url": { "type": "string" } } }, "domain.CreateUserMCPUpstreamReq": { "type": "object", "properties": { "description": { "type": "string" }, "enabled": { "type": "boolean" }, "headers": { "type": "array", "items": { "$ref": "#/definitions/domain.MCPHeader" } }, "name": { "type": "string" }, "slug": { "type": "string" }, "url": { "type": "string" } } }, "domain.CreateVMReq": { "type": "object", "required": [ "host_id", "image_id", "model_id", "name", "resource" ], "properties": { "git_identity_id": { "type": "string" }, "host_id": { "type": "string" }, "image_id": { "type": "string" }, "install_coding_agents": { "type": "boolean" }, "life": { "type": "integer" }, "model_id": { "type": "string" }, "name": { "type": "string" }, "repo": { "$ref": "#/definitions/domain.TaskRepoReq" }, "resource": { "$ref": "#/definitions/domain.Resource" } } }, "domain.DeleteImageReq": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string" } } }, "domain.FileChangeReq": { "type": "object", "required": [ "id", "source", "target" ], "properties": { "id": { "description": "虚拟机 id", "type": "string" }, "source": { "description": "来源", "type": "string" }, "target": { "description": "目标", "type": "string" } } }, "domain.FilePathReq": { "type": "object", "required": [ "id", "path" ], "properties": { "id": { "description": "虚拟机 id", "type": "string" }, "path": { "description": "文件/目录路径", "type": "string" } } }, "domain.FileSaveReq": { "type": "object", "required": [ "id", "path" ], "properties": { "content": { "description": "文件内容", "type": "string" }, "id": { "description": "虚拟机 id", "type": "string" }, "path": { "description": "文件路径", "type": "string" } } }, "domain.GetProviderModelListResp": { "type": "object", "properties": { "error": { "$ref": "#/definitions/domain.OpenAIError" }, "models": { "type": "array", "items": { "$ref": "#/definitions/domain.ProviderModelListItem" } } } }, "domain.GitBot": { "type": "object", "properties": { "created_at": { "type": "integer" }, "host": { "$ref": "#/definitions/domain.Host" }, "id": { "type": "string" }, "name": { "type": "string" }, "platform": { "$ref": "#/definitions/consts.GitPlatform" }, "secret_token": { "type": "string" }, "token": { "type": "string" }, "users": { "type": "array", "items": { "$ref": "#/definitions/domain.User" } }, "webhook_url": { "type": "string" } } }, "domain.GitBotTask": { "type": "object", "properties": { "bot": { "$ref": "#/definitions/domain.GitBot" }, "created_at": { "type": "integer" }, "id": { "type": "string" }, "pull_request": { "$ref": "#/definitions/domain.PullRequest" }, "repo": { "$ref": "#/definitions/domain.GitRepository" }, "status": { "$ref": "#/definitions/consts.TaskStatus" } } }, "domain.GitIdentity": { "type": "object", "properties": { "access_token": { "type": "string" }, "authorized_repositories": { "type": "array", "items": { "$ref": "#/definitions/domain.AuthRepository" } }, "base_url": { "type": "string" }, "created_at": { "type": "string" }, "email": { "type": "string" }, "id": { "type": "string" }, "is_installation_app": { "type": "boolean" }, "organization_id": { "description": "云效 Codeup 组织 ID", "type": "string" }, "platform": { "$ref": "#/definitions/consts.GitPlatform" }, "remark": { "type": "string" }, "repo_page_info": { "description": "仅当请求带分页参数时返回", "allOf": [ { "$ref": "#/definitions/web.PageInfo" } ] }, "username": { "type": "string" } } }, "domain.GitRepository": { "type": "object", "properties": { "owner": { "type": "string" }, "platform": { "$ref": "#/definitions/consts.GitPlatform" }, "repo_name": { "type": "string" }, "url": { "type": "string" } } }, "domain.Host": { "type": "object", "properties": { "arch": { "type": "string" }, "cores": { "type": "integer" }, "default": { "type": "boolean" }, "external_ip": { "type": "string" }, "groups": { "type": "array", "items": { "$ref": "#/definitions/domain.TeamGroup" } }, "id": { "type": "string" }, "is_default": { "type": "boolean" }, "memory": { "type": "integer" }, "name": { "type": "string" }, "os": { "type": "string" }, "owner": { "$ref": "#/definitions/domain.Owner" }, "remark": { "type": "string" }, "status": { "$ref": "#/definitions/consts.HostStatus" }, "version": { "type": "string" }, "virtualmachines": { "type": "array", "items": { "$ref": "#/definitions/domain.VirtualMachine" } }, "weight": { "type": "integer" } } }, "domain.HostListResp": { "type": "object", "properties": { "hosts": { "type": "array", "items": { "$ref": "#/definitions/domain.Host" } } } }, "domain.IDReq-github_com_google_uuid_UUID": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string" } } }, "domain.Image": { "type": "object", "properties": { "created_at": { "type": "integer" }, "id": { "type": "string" }, "is_default": { "type": "boolean" }, "name": { "type": "string" }, "owner": { "$ref": "#/definitions/domain.Owner" }, "remark": { "type": "string" } } }, "domain.ImportTeamExtensionPackageResp": { "type": "object", "properties": { "created_images": { "type": "integer" }, "created_rules": { "type": "integer" }, "created_skills": { "type": "integer" }, "package_id": { "type": "string" }, "updated_images": { "type": "integer" }, "updated_rules": { "type": "integer" }, "updated_skills": { "type": "integer" }, "version": { "type": "string" } } }, "domain.InstallCommand": { "type": "object", "properties": { "command": { "type": "string" } } }, "domain.ListAuditsResponse": { "type": "object", "properties": { "audits": { "type": "array", "items": { "$ref": "#/definitions/domain.Audit" } }, "page": { "$ref": "#/definitions/db.Cursor" } } }, "domain.ListCollaboratorsResp": { "type": "object", "properties": { "collaborators": { "type": "array", "items": { "$ref": "#/definitions/domain.Collaborator" } } } }, "domain.ListGitBotResp": { "type": "object", "properties": { "bots": { "type": "array", "items": { "$ref": "#/definitions/domain.GitBot" } } } }, "domain.ListGitBotTaskResp": { "type": "object", "properties": { "page": { "type": "integer" }, "size": { "type": "integer" }, "tasks": { "type": "array", "items": { "$ref": "#/definitions/domain.GitBotTask" } }, "total": { "type": "integer" } } }, "domain.ListImageResp": { "type": "object", "properties": { "images": { "type": "array", "items": { "$ref": "#/definitions/domain.Image" } }, "page": { "$ref": "#/definitions/db.Cursor" } } }, "domain.ListIssueCommentsResp": { "type": "object", "properties": { "comments": { "type": "array", "items": { "$ref": "#/definitions/domain.ProjectIssueComment" } }, "page": { "$ref": "#/definitions/db.Cursor" } } }, "domain.ListIssuesResp": { "type": "object", "properties": { "issues": { "type": "array", "items": { "$ref": "#/definitions/domain.ProjectIssue" } }, "page": { "$ref": "#/definitions/db.Cursor" } } }, "domain.ListModelResp": { "type": "object", "properties": { "models": { "type": "array", "items": { "$ref": "#/definitions/domain.Model" } }, "page": { "$ref": "#/definitions/db.Cursor" } } }, "domain.ListProjectResp": { "type": "object", "properties": { "page": { "$ref": "#/definitions/db.Cursor" }, "projects": { "type": "array", "items": { "$ref": "#/definitions/domain.Project" } } } }, "domain.ListTaskResp": { "type": "object", "properties": { "page_info": { "$ref": "#/definitions/db.PageInfo" }, "tasks": { "type": "array", "items": { "$ref": "#/definitions/domain.ProjectTask" } } } }, "domain.ListTeamGroupUsersResp": { "type": "object", "properties": { "users": { "type": "array", "items": { "$ref": "#/definitions/domain.User" } } } }, "domain.ListTeamGroupsResp": { "type": "object", "properties": { "groups": { "type": "array", "items": { "$ref": "#/definitions/domain.TeamGroup" } } } }, "domain.ListTeamHostsResp": { "type": "object", "properties": { "hosts": { "type": "array", "items": { "$ref": "#/definitions/domain.Host" } } } }, "domain.ListTeamImagesResp": { "type": "object", "properties": { "images": { "type": "array", "items": { "$ref": "#/definitions/domain.TeamImage" } } } }, "domain.ListTeamMCPUpstreamsResp": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/definitions/domain.TeamMCPUpstream" } } } }, "domain.ListTeamModelsResp": { "type": "object", "properties": { "models": { "type": "array", "items": { "$ref": "#/definitions/domain.TeamModel" } } } }, "domain.ListTeamSkillsResp": { "type": "object", "properties": { "skills": { "type": "array", "items": { "$ref": "#/definitions/domain.TeamSkill" } } } }, "domain.ListUserMCPUpstreamsResp": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/definitions/domain.MCPUpstream" } } } }, "domain.MCPHeader": { "type": "object", "properties": { "name": { "type": "string" }, "value": { "type": "string" } } }, "domain.MCPTool": { "type": "object", "properties": { "created_at": { "type": "integer" }, "description": { "type": "string" }, "enabled": { "type": "boolean" }, "id": { "type": "string" }, "input_schema": { "type": "object", "additionalProperties": {} }, "name": { "type": "string" }, "namespaced_name": { "type": "string" }, "price": { "type": "integer" }, "scope": { "$ref": "#/definitions/mcptool.Scope" } } }, "domain.MCPUpstream": { "type": "object", "properties": { "created_at": { "type": "integer" }, "description": { "type": "string" }, "enabled": { "type": "boolean" }, "headers": { "type": "array", "items": { "$ref": "#/definitions/domain.MCPHeader" } }, "health_checked_at": { "type": "integer" }, "health_status": { "type": "string" }, "id": { "type": "string" }, "last_synced_at": { "type": "integer" }, "name": { "type": "string" }, "scope": { "$ref": "#/definitions/mcpupstream.Scope" }, "slug": { "type": "string" }, "sync_status": { "type": "string" }, "tools": { "type": "array", "items": { "$ref": "#/definitions/domain.MCPTool" } }, "type": { "type": "string" }, "url": { "type": "string" }, "user": { "$ref": "#/definitions/domain.User" } } }, "domain.MemberListResp": { "type": "object", "properties": { "member_limit": { "type": "integer" }, "members": { "type": "array", "items": { "$ref": "#/definitions/domain.TeamMemberInfo" } } } }, "domain.Model": { "type": "object", "properties": { "access_level": { "description": "访问级别 basic | pro", "type": "string" }, "api_key": { "type": "string" }, "base_url": { "type": "string" }, "context_limit": { "type": "integer" }, "created_at": { "type": "integer" }, "id": { "type": "string" }, "interface_type": { "$ref": "#/definitions/consts.InterfaceType" }, "is_default": { "type": "boolean" }, "is_free": { "type": "boolean" }, "is_hidden": { "type": "boolean" }, "last_check_at": { "type": "integer" }, "last_check_error": { "type": "string" }, "last_check_success": { "type": "boolean" }, "model": { "type": "string" }, "output_limit": { "type": "integer" }, "owner": { "$ref": "#/definitions/domain.Owner" }, "provider": { "type": "string" }, "remark": { "type": "string" }, "support_image": { "type": "boolean" }, "temperature": { "type": "number" }, "thinking_enabled": { "type": "boolean" }, "updated_at": { "type": "integer" }, "weight": { "type": "integer" } } }, "domain.ModelBrief": { "type": "object", "properties": { "access_level": { "type": "string" }, "context_limit": { "type": "integer" }, "created_at": { "type": "integer" }, "id": { "type": "string" }, "interface_type": { "$ref": "#/definitions/consts.InterfaceType" }, "is_free": { "type": "boolean" }, "is_hidden": { "type": "boolean" }, "last_check_at": { "type": "integer" }, "last_check_error": { "type": "string" }, "last_check_success": { "type": "boolean" }, "model": { "type": "string" }, "output_limit": { "type": "integer" }, "owner": { "$ref": "#/definitions/domain.Owner" }, "provider": { "type": "string" }, "remark": { "type": "string" }, "support_image": { "type": "boolean" }, "temperature": { "type": "number" }, "thinking_enabled": { "type": "boolean" }, "updated_at": { "type": "integer" }, "weight": { "type": "integer" } } }, "domain.NotifyChannel": { "type": "object", "properties": { "created_at": { "type": "integer" }, "enabled": { "type": "boolean" }, "event_types": { "type": "array", "items": { "$ref": "#/definitions/consts.NotifyEventType" } }, "id": { "type": "string" }, "kind": { "$ref": "#/definitions/consts.NotifyChannelKind" }, "name": { "type": "string" }, "owner_id": { "type": "string" }, "owner_type": { "$ref": "#/definitions/consts.NotifyOwnerType" }, "scope": { "type": "string" }, "webhook_url": { "type": "string" } } }, "domain.OAuthLoginResp": { "type": "object", "properties": { "auth_url": { "type": "string" } } }, "domain.OpenAIError": { "type": "object", "properties": { "message": { "type": "string" }, "type": { "type": "string" } } }, "domain.Owner": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "type": { "$ref": "#/definitions/consts.OwnerType" } } }, "domain.PluginListItem": { "type": "object", "properties": { "active_version": { "type": "string" }, "description": { "type": "string" }, "enabled": { "type": "boolean" }, "entry": { "type": "string" }, "id": { "type": "string" }, "is_force_delivery": { "type": "boolean" }, "name": { "type": "string" }, "scope": { "$ref": "#/definitions/domain.SkillScope" } } }, "domain.ProductEdition": { "type": "string", "enum": [ "saas", "private" ], "x-enum-varnames": [ "ProductEditionSaaS", "ProductEditionPrivate" ] }, "domain.ProductRegion": { "type": "string", "enum": [ "cn", "global" ], "x-enum-varnames": [ "ProductRegionCN", "ProductRegionGlobal" ] }, "domain.Project": { "type": "object", "properties": { "auto_review_enabled": { "description": "是否开启自动审查", "type": "boolean" }, "collaborators": { "type": "array", "items": { "$ref": "#/definitions/domain.Collaborator" } }, "created_at": { "type": "integer" }, "description": { "type": "string" }, "env_variables": { "type": "object", "additionalProperties": {} }, "full_name": { "type": "string" }, "git_identity_id": { "type": "string" }, "id": { "type": "string" }, "image_id": { "type": "string" }, "issues": { "type": "array", "items": { "$ref": "#/definitions/domain.ProjectIssue" } }, "name": { "type": "string" }, "platform": { "$ref": "#/definitions/consts.GitPlatform" }, "repo_url": { "type": "string" }, "tasks": { "type": "array", "items": { "$ref": "#/definitions/domain.ProjectTask" } }, "updated_at": { "type": "integer" }, "user": { "$ref": "#/definitions/domain.User" } } }, "domain.ProjectBlob": { "type": "object", "properties": { "content": { "type": "array", "items": { "type": "integer" } }, "is_binary": { "type": "boolean" }, "sha": { "type": "string" }, "size": { "type": "integer" } } }, "domain.ProjectCommit": { "type": "object", "properties": { "author": { "$ref": "#/definitions/domain.ProjectCommitUser" }, "committer": { "$ref": "#/definitions/domain.ProjectCommitUser" }, "message": { "type": "string" }, "parent_shas": { "type": "array", "items": { "type": "string" } }, "sha": { "type": "string" }, "tree_sha": { "type": "string" } } }, "domain.ProjectCommitEntry": { "type": "object", "properties": { "commit": { "$ref": "#/definitions/domain.ProjectCommit" } } }, "domain.ProjectCommitUser": { "type": "object", "properties": { "email": { "type": "string" }, "name": { "type": "string" }, "when": { "type": "integer" } } }, "domain.ProjectIssue": { "type": "object", "properties": { "assignee": { "$ref": "#/definitions/domain.User" }, "created_at": { "type": "integer" }, "design_document": { "type": "string" }, "id": { "type": "string" }, "priority": { "$ref": "#/definitions/consts.ProjectIssuePriority" }, "requirement_document": { "type": "string" }, "status": { "$ref": "#/definitions/consts.ProjectIssueStatus" }, "summary": { "type": "string" }, "title": { "type": "string" }, "user": { "$ref": "#/definitions/domain.User" } } }, "domain.ProjectIssueComment": { "type": "object", "properties": { "comment": { "type": "string" }, "created_at": { "type": "integer" }, "creator": { "$ref": "#/definitions/domain.User" }, "id": { "type": "string" }, "parent": { "$ref": "#/definitions/domain.ProjectIssueComment" }, "replies": { "type": "array", "items": { "$ref": "#/definitions/domain.ProjectIssueComment" } } } }, "domain.ProjectLogs": { "type": "object", "properties": { "count": { "type": "integer" }, "entries": { "type": "array", "items": { "$ref": "#/definitions/domain.ProjectCommitEntry" } } } }, "domain.ProjectTask": { "type": "object", "required": [ "id" ], "properties": { "branch": { "type": "string" }, "cli_name": { "$ref": "#/definitions/consts.CliName" }, "completed_at": { "type": "integer" }, "content": { "type": "string" }, "created_at": { "type": "integer" }, "extra": { "$ref": "#/definitions/domain.TaskExtraConfig" }, "full_name": { "type": "string" }, "id": { "type": "string" }, "image": { "$ref": "#/definitions/domain.Image" }, "last_active_at": { "type": "integer" }, "log_store": { "$ref": "#/definitions/consts.LogStore" }, "model": { "$ref": "#/definitions/domain.ModelBrief" }, "repo_filename": { "type": "string" }, "repo_url": { "type": "string" }, "stats": { "$ref": "#/definitions/domain.TaskStats" }, "status": { "$ref": "#/definitions/consts.TaskStatus" }, "sub_type": { "$ref": "#/definitions/consts.TaskSubType" }, "summary": { "type": "string" }, "title": { "type": "string" }, "type": { "$ref": "#/definitions/consts.TaskType" }, "user_id": { "type": "string" }, "virtualmachine": { "$ref": "#/definitions/domain.VirtualMachine" } } }, "domain.ProjectTreeEntry": { "type": "object", "properties": { "last_modified_at": { "type": "integer" }, "mode": { "type": "integer" }, "name": { "type": "string" }, "path": { "type": "string" }, "sha": { "type": "string" }, "size": { "type": "integer" } } }, "domain.ProviderModelListItem": { "type": "object", "properties": { "model": { "type": "string" } } }, "domain.PullRequest": { "type": "object", "properties": { "title": { "type": "string" }, "url": { "type": "string" } } }, "domain.RecyclePortReq": { "type": "object", "required": [ "forward_id" ], "properties": { "forward_id": { "type": "string" } } }, "domain.RedeemCaptchaReq": { "type": "object", "properties": { "solutions": { "type": "array", "items": { "type": "integer" } }, "token": { "type": "string" } } }, "domain.ResetUserPasswordEmailReq": { "type": "object", "required": [ "emails" ], "properties": { "captcha_token": { "type": "string" }, "emails": { "type": "array", "items": { "type": "string" } } } }, "domain.ResetUserPasswordReq": { "type": "object", "required": [ "new_password", "token" ], "properties": { "new_password": { "type": "string" }, "token": { "type": "string" } } }, "domain.Resource": { "type": "object", "properties": { "cpu": { "type": "integer" }, "memory": { "type": "integer" } } }, "domain.SaveTeamOIDCConfigReq": { "type": "object", "required": [ "client_id", "display_name", "issuer" ], "properties": { "allow_password_login": { "type": "boolean" }, "auto_create_member": { "type": "boolean" }, "client_id": { "type": "string" }, "client_secret": { "type": "string" }, "display_name": { "type": "string" }, "email_domain": { "type": "string" }, "enabled": { "type": "boolean" }, "issuer": { "type": "string" }, "scopes": { "type": "string" } } }, "domain.SendBindEmailVerificationReq": { "type": "object", "required": [ "email" ], "properties": { "email": { "description": "要绑定的邮箱地址", "type": "string" } } }, "domain.ServerConfig": { "type": "object", "properties": { "current_version": { "description": "CurrentVersion 当前服务版本。", "type": "string", "example": "v1.2.3" }, "edition": { "description": "Edition 当前产品形态:SaaS 或私有化版本。", "enum": [ "saas", "private" ], "allOf": [ { "$ref": "#/definitions/domain.ProductEdition" } ], "example": "saas" }, "latest_version": { "description": "LatestVersion 最新可用版本。", "type": "string", "example": "v1.2.4" }, "region": { "description": "Region SaaS 区域,国内 SaaS 返回 cn,海外 SaaS 返回 global。", "enum": [ "cn", "global" ], "allOf": [ { "$ref": "#/definitions/domain.ProductRegion" } ], "example": "cn" } } }, "domain.ShareGitBotReq": { "type": "object", "properties": { "id": { "type": "string" }, "user_ids": { "type": "array", "items": { "type": "string" } } } }, "domain.ShareTerminalReq": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string" }, "mode": { "$ref": "#/definitions/consts.TerminalMode" }, "terminal_id": { "type": "string" } } }, "domain.ShareTerminalResp": { "type": "object", "properties": { "password": { "type": "string" } } }, "domain.SkillGroupRef": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" } } }, "domain.SkillListItem": { "type": "object", "properties": { "active_version": { "type": "string" }, "categories": { "type": "array", "items": { "type": "string" } }, "description": { "type": "string" }, "enabled": { "type": "boolean" }, "groups": { "type": "array", "items": { "$ref": "#/definitions/domain.SkillGroupRef" } }, "id": { "type": "string" }, "is_force_delivery": { "type": "boolean" }, "name": { "type": "string" }, "scope": { "$ref": "#/definitions/domain.SkillScope" }, "tags": { "type": "array", "items": { "type": "string" } } } }, "domain.SkillScope": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" } } }, "domain.SpeechRecognitionData": { "type": "object", "properties": { "error": { "description": "错误信息 (仅error类型)", "type": "string", "example": "识别失败" }, "is_final": { "description": "是否为最终结果 (仅result类型)", "type": "boolean", "example": false }, "text": { "description": "识别文本 (仅result类型)", "type": "string", "example": "你好" }, "timestamp": { "description": "时间戳 (仅result类型)", "type": "integer", "example": 1640995200000 }, "type": { "description": "数据类型: result, end, error", "type": "string", "example": "result" }, "user_id": { "description": "用户ID (仅result类型)", "type": "string", "example": "uuid" } } }, "domain.SpeechRecognitionEvent": { "type": "object", "properties": { "data": { "description": "事件数据", "allOf": [ { "$ref": "#/definitions/domain.SpeechRecognitionData" } ] }, "event": { "description": "事件类型: recognition, end, error", "type": "string" } } }, "domain.SpeechStreamError": { "type": "object", "properties": { "code": { "description": "错误码;远端 ASR 错误码 (如豆包 45000001),本地校验错误为 0", "type": "integer", "example": 45000001 }, "logid": { "description": "远端 ASR 服务返回的 trace id (如豆包 X-Tt-Logid),报障必备", "type": "string", "example": "202407261553070FACFE6D19421815D605" }, "message": { "description": "错误描述,远端错误为远端 message,本地校验错误为可读原因", "type": "string", "example": "请求参数无效" }, "request_id": { "description": "后端发给远端 ASR 的 X-Api-Request-Id (UUID),便于跟单次请求关联日志", "type": "string", "example": "67ee89ba-7050-4c04-a3d7-ac61a63499b3" } } }, "domain.SpeechStreamEvent": { "type": "object", "properties": { "error": { "description": "错误详情;仅 error 事件携带", "allOf": [ { "$ref": "#/definitions/domain.SpeechStreamError" } ] }, "index": { "description": "句子序号,从 1 开始;partial / final 携带,其余事件省略", "type": "integer", "example": 1 }, "logid": { "description": "远端 ASR 服务的 trace id;ready / error 事件携带,便于全程关联日志", "type": "string", "example": "202407261553070FACFE6D19421815D605" }, "text": { "description": "识别文本;partial(中间结果,会反复变化)/ final(本句定稿)携带", "type": "string", "example": "今天天气真不错。" }, "timestamp": { "description": "服务端时间(毫秒),所有事件都有", "type": "integer", "example": 1733299200000 }, "type": { "description": "事件类型:ready / partial / final / done / error", "type": "string", "enum": [ "ready", "partial", "final", "done", "error" ], "example": "partial" } } }, "domain.SpeechStreamStartReq": { "type": "object", "required": [ "type" ], "properties": { "disfluency": { "description": "是否启用语义顺滑(过滤\"嗯/啊\"等口头禅、语义重复词),默认 false", "type": "boolean", "example": false }, "format": { "description": "音频容器格式,单声道、16-bit、采样率固定 16000Hz。\npcm / wav 内部音频流必须是 pcm_s16le;ogg 必须为 opus 编码;mp3 由服务端解码。", "type": "string", "enum": [ "pcm", "wav", "ogg", "mp3" ], "example": "pcm" }, "type": { "description": "消息类型,固定为 \"start\"", "type": "string", "example": "start" } } }, "domain.SubscriptionResp": { "type": "object", "properties": { "auto_renew": { "type": "boolean" }, "expires_at": { "type": "string" }, "plan": { "type": "string" }, "source": { "type": "string" } } }, "domain.Task": { "type": "object", "properties": { "branch": { "type": "string" }, "cli_name": { "$ref": "#/definitions/consts.CliName" }, "completed_at": { "type": "integer" }, "content": { "type": "string" }, "created_at": { "type": "integer" }, "extra": { "$ref": "#/definitions/domain.TaskExtraConfig" }, "full_name": { "type": "string" }, "id": { "type": "string" }, "image": { "$ref": "#/definitions/domain.Image" }, "last_active_at": { "type": "integer" }, "log_store": { "$ref": "#/definitions/consts.LogStore" }, "model": { "$ref": "#/definitions/domain.ModelBrief" }, "repo_filename": { "type": "string" }, "repo_url": { "type": "string" }, "stats": { "$ref": "#/definitions/domain.TaskStats" }, "status": { "$ref": "#/definitions/consts.TaskStatus" }, "sub_type": { "$ref": "#/definitions/consts.TaskSubType" }, "summary": { "type": "string" }, "title": { "type": "string" }, "type": { "$ref": "#/definitions/consts.TaskType" }, "user_id": { "type": "string" }, "virtualmachine": { "$ref": "#/definitions/domain.VirtualMachine" } } }, "domain.TaskAttachment": { "type": "object", "properties": { "filename": { "type": "string" }, "url": { "type": "string" } } }, "domain.TaskChunkEntry": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "integer" } }, "event": { "type": "string" }, "kind": { "type": "string" }, "labels": { "type": "object", "additionalProperties": { "type": "string" } }, "seq": { "description": "消息序号,来自 ClickHouse msg_seq_start", "type": "integer" }, "timestamp": { "type": "integer" }, "turn_seq": { "description": "轮次号,可作为 cursor 翻页;仅日志存储为 ClickHouse 时有值", "type": "integer" } } }, "domain.TaskExtraConfig": { "type": "object", "properties": { "issue_id": { "type": "string" }, "plugin_ids": { "description": "Plugin IDs 数组(仅 OpenCode 真正下发)", "type": "array", "items": { "type": "string" } }, "project_id": { "type": "string" }, "skill_ids": { "type": "array", "items": { "type": "string" } } } }, "domain.TaskRepoReq": { "type": "object", "properties": { "branch": { "type": "string" }, "repo_filename": { "type": "string" }, "repo_url": { "type": "string" }, "zip_url": { "type": "string" } } }, "domain.TaskRoundsResp": { "type": "object", "properties": { "chunks": { "type": "array", "items": { "$ref": "#/definitions/domain.TaskChunkEntry" } }, "has_more": { "type": "boolean" }, "next_cursor": { "description": "下一页游标", "type": "string" } } }, "domain.TaskStats": { "type": "object", "properties": { "input_tokens": { "type": "integer" }, "llm_requests": { "type": "integer" }, "output_tokens": { "type": "integer" }, "total_tokens": { "type": "integer" } } }, "domain.TaskUserInputItem": { "type": "object", "properties": { "content": { "description": "用户输入文本,超过 500 字符截断", "type": "string" }, "id": { "description": "与前端 message.id 对齐:user-input-{timestamp}", "type": "string" }, "seq": { "description": "轮次号,可作为 /rounds 的 cursor 跳转定位;仅日志存储为 ClickHouse 时有值", "type": "integer" }, "timestamp": { "description": "纳秒,与 chunk.timestamp 对齐", "type": "integer" }, "truncated": { "description": "是否被截断", "type": "boolean" } } }, "domain.TaskUserInputsResp": { "type": "object", "properties": { "has_more": { "type": "boolean" }, "items": { "type": "array", "items": { "$ref": "#/definitions/domain.TaskUserInputItem" } }, "next_cursor": { "type": "string" } } }, "domain.Team": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" } } }, "domain.TeamConversationItem": { "type": "object", "properties": { "attachment_count": { "type": "integer" }, "content": { "type": "string" }, "created_at": { "type": "integer" }, "creator": { "$ref": "#/definitions/domain.User" }, "id": { "type": "string" }, "project_id": { "type": "string" }, "project_name": { "type": "string" }, "task_id": { "type": "string" }, "task_title": { "type": "string" } } }, "domain.TeamConversationListResp": { "type": "object", "properties": { "conversations": { "type": "array", "items": { "$ref": "#/definitions/domain.TeamConversationItem" } }, "page": { "$ref": "#/definitions/db.Cursor" } } }, "domain.TeamConversationStats": { "type": "object", "properties": { "count_7d": { "type": "integer" }, "count_today": { "type": "integer" }, "daily_created": { "type": "array", "items": { "$ref": "#/definitions/domain.TeamDashboardTrendPoint" } }, "total": { "type": "integer" } } }, "domain.TeamDashboardConsumptionInsight": { "type": "object", "properties": { "id": { "type": "string" }, "llm_requests": { "type": "integer" }, "name": { "type": "string" }, "percent": { "type": "number" }, "total_tokens": { "type": "integer" }, "type": { "type": "string" } } }, "domain.TeamDashboardInsights": { "type": "object", "properties": { "active_members": { "type": "array", "items": { "$ref": "#/definitions/domain.TeamDashboardMemberInsight" } }, "high_consumption": { "type": "array", "items": { "$ref": "#/definitions/domain.TeamDashboardConsumptionInsight" } }, "long_running_tasks": { "type": "array", "items": { "$ref": "#/definitions/domain.TeamDashboardTaskInsight" } } } }, "domain.TeamDashboardMemberInsight": { "type": "object", "properties": { "email": { "type": "string" }, "group_name": { "type": "string" }, "last_active_at": { "type": "integer" }, "name": { "type": "string" }, "task_count": { "type": "integer" }, "user_id": { "type": "string" } } }, "domain.TeamDashboardMetrics": { "type": "object", "properties": { "active_members": { "type": "integer" }, "active_rate": { "type": "number" }, "average_duration": { "type": "integer" }, "cache_hit_rate": { "type": "number" }, "cached_tokens": { "type": "integer" }, "finished_task_count": { "type": "integer" }, "input_tokens": { "type": "integer" }, "llm_requests": { "type": "integer" }, "output_tokens": { "type": "integer" }, "running_task_count": { "type": "integer" }, "task_count": { "type": "integer" }, "total_members": { "type": "integer" }, "total_tokens": { "type": "integer" } } }, "domain.TeamDashboardResp": { "type": "object", "properties": { "conversation_stats": { "$ref": "#/definitions/domain.TeamConversationStats" }, "end_at": { "type": "integer" }, "insights": { "$ref": "#/definitions/domain.TeamDashboardInsights" }, "metrics": { "$ref": "#/definitions/domain.TeamDashboardMetrics" }, "project_stats": { "$ref": "#/definitions/domain.TeamProjectStats" }, "range": { "type": "string" }, "start_at": { "type": "integer" }, "task_stats": { "$ref": "#/definitions/domain.TeamTaskStats" }, "trends": { "$ref": "#/definitions/domain.TeamDashboardTrends" } } }, "domain.TeamDashboardTaskInsight": { "type": "object", "properties": { "created_at": { "type": "integer" }, "creator": { "type": "string" }, "duration": { "type": "integer" }, "host_name": { "type": "string" }, "status": { "type": "string" }, "task_id": { "type": "string" }, "title": { "type": "string" } } }, "domain.TeamDashboardTrendPoint": { "type": "object", "properties": { "date": { "type": "string" }, "value": { "type": "integer" } } }, "domain.TeamDashboardTrends": { "type": "object", "properties": { "active_members": { "type": "array", "items": { "$ref": "#/definitions/domain.TeamDashboardTrendPoint" } }, "task_counts": { "type": "array", "items": { "$ref": "#/definitions/domain.TeamDashboardTrendPoint" } }, "token_usage": { "type": "array", "items": { "$ref": "#/definitions/domain.TeamDashboardTrendPoint" } } } }, "domain.TeamGroup": { "type": "object", "properties": { "created_at": { "type": "integer" }, "id": { "type": "string" }, "name": { "type": "string" }, "updated_at": { "type": "integer" }, "users": { "type": "array", "items": { "$ref": "#/definitions/domain.User" } } } }, "domain.TeamImage": { "type": "object", "properties": { "created_at": { "type": "integer" }, "groups": { "type": "array", "items": { "$ref": "#/definitions/domain.TeamGroup" } }, "id": { "type": "string" }, "name": { "type": "string" }, "remark": { "type": "string" }, "updated_at": { "type": "integer" } } }, "domain.TeamLoginReq": { "type": "object", "required": [ "email", "password" ], "properties": { "captcha_token": { "description": "验证码Token", "type": "string" }, "email": { "description": "用户邮箱", "type": "string" }, "password": { "description": "用户密码(MD5加密后的值)", "type": "string" } } }, "domain.TeamMCPUpstream": { "type": "object", "properties": { "created_at": { "type": "integer" }, "description": { "type": "string" }, "enabled": { "type": "boolean" }, "groups": { "type": "array", "items": { "$ref": "#/definitions/domain.SkillGroupRef" } }, "headers": { "type": "array", "items": { "$ref": "#/definitions/domain.MCPHeader" } }, "health_checked_at": { "type": "integer" }, "health_status": { "type": "string" }, "id": { "type": "string" }, "last_synced_at": { "type": "integer" }, "name": { "type": "string" }, "scope": { "$ref": "#/definitions/mcpupstream.Scope" }, "slug": { "type": "string" }, "sync_status": { "type": "string" }, "team_id": { "type": "string" }, "tools": { "type": "array", "items": { "$ref": "#/definitions/domain.MCPTool" } }, "type": { "type": "string" }, "url": { "type": "string" }, "user": { "$ref": "#/definitions/domain.User" } } }, "domain.TeamMember": { "type": "object", "properties": { "team_id": { "type": "string" }, "team_name": { "type": "string" }, "team_role": { "$ref": "#/definitions/consts.TeamMemberRole" }, "user_id": { "type": "string" } } }, "domain.TeamMemberInfo": { "type": "object", "properties": { "created_at": { "type": "integer" }, "last_active_at": { "type": "integer" }, "role": { "$ref": "#/definitions/consts.TeamMemberRole" }, "user": { "$ref": "#/definitions/domain.User" } } }, "domain.TeamModel": { "type": "object", "properties": { "api_key": { "type": "string" }, "base_url": { "type": "string" }, "created_at": { "type": "integer" }, "groups": { "type": "array", "items": { "$ref": "#/definitions/domain.TeamGroup" } }, "id": { "type": "string" }, "interface_type": { "$ref": "#/definitions/consts.InterfaceType" }, "is_hidden": { "type": "boolean" }, "last_check_at": { "type": "integer" }, "last_check_error": { "type": "string" }, "last_check_success": { "type": "boolean" }, "model": { "type": "string" }, "provider": { "type": "string" }, "remark": { "type": "string" }, "support_image": { "type": "boolean" }, "temperature": { "type": "number" }, "updated_at": { "type": "integer" } } }, "domain.TeamOIDCConfig": { "type": "object", "properties": { "allow_password_login": { "type": "boolean" }, "auto_create_member": { "type": "boolean" }, "client_id": { "type": "string" }, "display_name": { "type": "string" }, "email_domain": { "type": "string" }, "enabled": { "type": "boolean" }, "has_client_secret": { "type": "boolean" }, "id": { "type": "string" }, "issuer": { "type": "string" }, "login_url": { "type": "string" }, "redirect_uri": { "type": "string" }, "scopes": { "type": "string" }, "team_id": { "type": "string" } } }, "domain.TeamOIDCConfigResp": { "type": "object", "properties": { "config": { "$ref": "#/definitions/domain.TeamOIDCConfig" } } }, "domain.TeamOIDCPublicConfigResp": { "type": "object", "properties": { "display_name": { "type": "string" }, "enabled": { "type": "boolean" }, "login_url": { "type": "string" }, "team_id": { "type": "string" } } }, "domain.TeamOIDCTestResp": { "type": "object", "properties": { "issuer": { "type": "string" }, "message": { "type": "string" }, "success": { "type": "boolean" } } }, "domain.TeamProjectItem": { "type": "object", "properties": { "branch": { "type": "string" }, "created_at": { "type": "integer" }, "creator": { "$ref": "#/definitions/domain.User" }, "id": { "type": "string" }, "issue_count": { "type": "integer" }, "name": { "type": "string" }, "repo_url": { "type": "string" }, "task_count": { "type": "integer" }, "updated_at": { "type": "integer" } } }, "domain.TeamProjectListResp": { "type": "object", "properties": { "page": { "$ref": "#/definitions/db.Cursor" }, "projects": { "type": "array", "items": { "$ref": "#/definitions/domain.TeamProjectItem" } } } }, "domain.TeamProjectStats": { "type": "object", "properties": { "active_7d": { "type": "integer" }, "active_today": { "type": "integer" }, "daily_created": { "type": "array", "items": { "$ref": "#/definitions/domain.TeamDashboardTrendPoint" } }, "total": { "type": "integer" } } }, "domain.TeamSkill": { "type": "object", "properties": { "active_version": { "type": "string" }, "categories": { "type": "array", "items": { "type": "string" } }, "content": { "description": "SKILL.md 文本,从 active version 当时入库时记录", "type": "string" }, "created_at": { "type": "integer" }, "description": { "type": "string" }, "enabled": { "type": "boolean" }, "groups": { "type": "array", "items": { "$ref": "#/definitions/domain.SkillGroupRef" } }, "id": { "type": "string" }, "is_force_delivery": { "type": "boolean" }, "name": { "type": "string" }, "s3_key": { "type": "string" }, "skill_md_path": { "type": "string" }, "source_label": { "type": "string" }, "source_type": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "updated_at": { "type": "integer" } } }, "domain.TeamTaskItem": { "type": "object", "properties": { "content": { "type": "string" }, "created_at": { "type": "integer" }, "creator": { "$ref": "#/definitions/domain.User" }, "id": { "type": "string" }, "kind": { "type": "string" }, "last_active_at": { "type": "integer" }, "project_id": { "type": "string" }, "project_name": { "type": "string" }, "status": { "type": "string" }, "title": { "type": "string" } } }, "domain.TeamTaskListResp": { "type": "object", "properties": { "page": { "$ref": "#/definitions/db.Cursor" }, "tasks": { "type": "array", "items": { "$ref": "#/definitions/domain.TeamTaskItem" } } } }, "domain.TeamTaskStats": { "type": "object", "properties": { "active_7d": { "type": "integer" }, "active_today": { "type": "integer" }, "daily_created": { "type": "array", "items": { "$ref": "#/definitions/domain.TeamDashboardTrendPoint" } }, "total": { "type": "integer" } } }, "domain.TeamTaskVMIdlePolicy": { "type": "object", "properties": { "effective_recycle_seconds": { "type": "integer" }, "effective_sleep_seconds": { "type": "integer" }, "recycle_enabled": { "type": "boolean" }, "recycle_inherited": { "type": "boolean" }, "recycle_seconds": { "type": "integer" }, "sleep_enabled": { "type": "boolean" }, "sleep_inherited": { "type": "boolean" }, "sleep_seconds": { "type": "integer" }, "task_concurrency_limit": { "type": "integer" }, "team_id": { "type": "string" } } }, "domain.TeamUser": { "type": "object", "properties": { "team": { "$ref": "#/definitions/domain.Team" }, "user": { "$ref": "#/definitions/domain.User" } } }, "domain.TeamUserInfo": { "type": "object", "properties": { "teams": { "type": "array", "items": { "$ref": "#/definitions/domain.TeamMember" } }, "user": { "$ref": "#/definitions/domain.User" } } }, "domain.TeamUserPassword": { "type": "object", "properties": { "email": { "type": "string" }, "password": { "type": "string" } } }, "domain.Terminal": { "type": "object", "properties": { "connected_count": { "type": "integer" }, "created_at": { "type": "integer" }, "id": { "type": "string" }, "title": { "type": "string" } } }, "domain.UpdateGitBotReq": { "type": "object", "required": [ "id" ], "properties": { "host_id": { "type": "string" }, "id": { "type": "string" }, "name": { "type": "string" }, "platform": { "$ref": "#/definitions/consts.GitPlatform" }, "token": { "type": "string" } } }, "domain.UpdateGitIdentityReq": { "type": "object", "properties": { "access_token": { "type": "string" }, "base_url": { "type": "string" }, "email": { "type": "string" }, "organization_id": { "type": "string" }, "platform": { "$ref": "#/definitions/consts.GitPlatform" }, "remark": { "type": "string" }, "username": { "type": "string" } } }, "domain.UpdateHostReq": { "type": "object", "properties": { "is_default": { "type": "boolean" }, "remark": { "type": "string" }, "weight": { "type": "integer", "minimum": 1 } } }, "domain.UpdateImageReq": { "type": "object", "properties": { "image_name": { "type": "string" }, "is_default": { "type": "boolean" }, "remark": { "type": "string" } } }, "domain.UpdateIssueReq": { "type": "object", "properties": { "assignee_id": { "type": "string" }, "design_document": { "type": "string" }, "priority": { "$ref": "#/definitions/consts.ProjectIssuePriority" }, "requirement_document": { "type": "string" }, "status": { "$ref": "#/definitions/consts.ProjectIssueStatus" }, "title": { "type": "string" } } }, "domain.UpdateModelReq": { "type": "object", "properties": { "api_key": { "type": "string" }, "base_url": { "type": "string" }, "context_limit": { "type": "integer" }, "interface_type": { "enum": [ "openai_chat", "openai_responses", "anthropic" ], "allOf": [ { "$ref": "#/definitions/consts.InterfaceType" } ] }, "is_default": { "type": "boolean" }, "is_hidden": { "type": "boolean" }, "model": { "type": "string" }, "output_limit": { "type": "integer" }, "provider": { "type": "string" }, "remark": { "type": "string" }, "support_image": { "type": "boolean" }, "temperature": { "type": "number" }, "thinking_enabled": { "type": "boolean" } } }, "domain.UpdateNotifyChannelReq": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "event_types": { "type": "array", "items": { "$ref": "#/definitions/consts.NotifyEventType" } }, "headers": { "type": "object", "additionalProperties": { "type": "string" } }, "name": { "type": "string" }, "secret": { "type": "string" }, "webhook_url": { "type": "string" } } }, "domain.UpdateProjectReq": { "type": "object", "properties": { "collaborators": { "type": "array", "items": { "$ref": "#/definitions/domain.CreateCollaboratorItem" } }, "description": { "type": "string" }, "env_variables": { "type": "object", "additionalProperties": {} }, "image_id": { "type": "string" }, "name": { "type": "string" } } }, "domain.UpdateTaskReq": { "type": "object", "properties": { "title": { "type": "string" } } }, "domain.UpdateTeamGroupReq": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string" } } }, "domain.UpdateTeamHostReq": { "type": "object", "properties": { "group_ids": { "type": "array", "items": { "type": "string" } }, "remark": { "type": "string" } } }, "domain.UpdateTeamImageReq": { "type": "object", "properties": { "group_ids": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "remark": { "type": "string" } } }, "domain.UpdateTeamMCPUpstreamReq": { "type": "object", "properties": { "description": { "type": "string" }, "enabled": { "type": "boolean" }, "group_ids": { "type": "array", "items": { "type": "string" } }, "headers": { "type": "array", "items": { "$ref": "#/definitions/domain.MCPHeader" } }, "name": { "type": "string" }, "slug": { "type": "string" }, "url": { "type": "string" } } }, "domain.UpdateTeamModelReq": { "type": "object", "properties": { "api_key": { "type": "string" }, "base_url": { "type": "string" }, "group_ids": { "type": "array", "items": { "type": "string" } }, "interface_type": { "enum": [ "openai_chat", "openai_responses", "anthropic" ], "allOf": [ { "$ref": "#/definitions/consts.InterfaceType" } ] }, "model": { "type": "string" }, "provider": { "type": "string" }, "remark": { "type": "string" }, "support_image": { "type": "boolean" }, "temperature": { "type": "number" } } }, "domain.UpdateTeamSkillReq": { "type": "object", "properties": { "content": { "type": "string" }, "description": { "type": "string" }, "group_ids": { "type": "array", "items": { "type": "string" } }, "is_force_delivery": { "type": "boolean" }, "name": { "description": "当前不允许改 name(unique 索引硬约束),保留位", "type": "string" }, "skill_md_path": { "type": "string" }, "source_label": { "type": "string" }, "source_type": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } } } }, "domain.UpdateTeamTaskVMIdlePolicyReq": { "type": "object", "properties": { "recycle_enabled": { "type": "boolean" }, "recycle_seconds": { "type": "integer" }, "sleep_enabled": { "type": "boolean" }, "sleep_seconds": { "type": "integer" }, "task_concurrency_limit": { "type": "integer" } } }, "domain.UpdateTeamUserReq": { "type": "object", "properties": { "is_blocked": { "type": "boolean" }, "name": { "type": "string" } } }, "domain.UpdateTeamUserResp": { "type": "object", "properties": { "user": { "$ref": "#/definitions/domain.User" } } }, "domain.UpdateUserMCPToolSettingReq": { "type": "object", "properties": { "enabled": { "type": "boolean" } } }, "domain.UpdateUserMCPUpstreamReq": { "type": "object", "properties": { "description": { "type": "string" }, "enabled": { "type": "boolean" }, "headers": { "type": "array", "items": { "$ref": "#/definitions/domain.MCPHeader" } }, "name": { "type": "string" }, "slug": { "type": "string" }, "url": { "type": "string" } } }, "domain.UpdateUserResp": { "type": "object", "properties": { "message": { "type": "string" }, "success": { "type": "boolean" }, "user": { "$ref": "#/definitions/domain.User" } } }, "domain.UpdateVMReq": { "type": "object", "required": [ "host_id", "id" ], "properties": { "host_id": { "type": "string" }, "id": { "type": "string" }, "life": { "type": "integer", "minimum": 3600 } } }, "domain.User": { "type": "object", "properties": { "avatar_url": { "type": "string" }, "email": { "type": "string" }, "has_password": { "type": "boolean" }, "id": { "type": "string" }, "identities": { "type": "array", "items": { "$ref": "#/definitions/domain.UserIdentity" } }, "is_blocked": { "type": "boolean" }, "name": { "type": "string" }, "role": { "$ref": "#/definitions/consts.UserRole" }, "status": { "$ref": "#/definitions/consts.UserStatus" }, "team": { "$ref": "#/definitions/domain.Team" }, "token": { "type": "string" }, "wechat_mp_bound": { "type": "boolean" } } }, "domain.UserIdentity": { "type": "object", "properties": { "avatar_url": { "type": "string" }, "email": { "type": "string" }, "id": { "type": "string" }, "identity_id": { "type": "string" }, "platform": { "$ref": "#/definitions/consts.UserPlatform" }, "username": { "type": "string" } } }, "domain.VMPort": { "type": "object", "properties": { "error_message": { "type": "string" }, "forward_id": { "type": "string" }, "port": { "type": "integer" }, "preview_url": { "type": "string" }, "status": { "$ref": "#/definitions/consts.PortStatus" }, "success": { "type": "boolean" }, "white_list": { "type": "array", "items": { "type": "string" } } } }, "domain.VMResource": { "type": "object", "properties": { "core": { "type": "integer", "default": 1 }, "life": { "type": "integer" }, "memory": { "type": "integer", "default": 1024 } } }, "domain.VirtualMachine": { "type": "object", "properties": { "conditions": { "type": "array", "items": { "$ref": "#/definitions/github_com_chaitin_MonkeyCode_backend_ent_types.Condition" } }, "cores": { "type": "integer" }, "created_at": { "type": "integer" }, "environment_id": { "type": "string" }, "host": { "$ref": "#/definitions/domain.Host" }, "hostname": { "type": "string" }, "id": { "type": "string" }, "life_time_seconds": { "type": "integer" }, "memory": { "type": "integer" }, "name": { "type": "string" }, "os": { "type": "string" }, "owner": { "$ref": "#/definitions/domain.User" }, "ports": { "type": "array", "items": { "$ref": "#/definitions/domain.VMPort" } }, "status": { "$ref": "#/definitions/taskflow.VirtualMachineStatus" }, "version": { "type": "string" } } }, "github_com_chaitin_MonkeyCode_backend_ent_types.Condition": { "type": "object", "properties": { "last_transition_time": { "type": "integer" }, "message": { "type": "string" }, "progress": { "type": "integer" }, "reason": { "type": "string" }, "status": { "$ref": "#/definitions/types.ConditionStatus" }, "type": { "$ref": "#/definitions/types.ConditionType" } } }, "gocap.ChallengeData": { "type": "object", "properties": { "challenge": { "$ref": "#/definitions/gocap.ChallengeItem" }, "expires": { "description": "过期时间,毫秒级时间戳", "type": "integer" }, "token": { "description": "质询令牌", "type": "string" } } }, "gocap.ChallengeItem": { "type": "object", "properties": { "c": { "description": "质询数量", "type": "integer" }, "d": { "description": "质询难度", "type": "integer" }, "s": { "description": "质询大小", "type": "integer" } } }, "gocap.VerificationResult": { "type": "object", "properties": { "expires": { "description": "过期时间,毫秒级时间戳", "type": "integer" }, "message": { "type": "string" }, "success": { "type": "boolean" }, "token": { "description": "验证令牌", "type": "string" } } }, "mcptool.Scope": { "type": "string", "enum": [ "user", "platform", "team" ], "x-enum-varnames": [ "ScopeUser", "ScopePlatform", "ScopeTeam" ] }, "mcpupstream.Scope": { "type": "string", "enum": [ "user", "platform", "team" ], "x-enum-varnames": [ "ScopeUser", "ScopePlatform", "ScopeTeam" ] }, "taskflow.File": { "type": "object", "properties": { "accessed_at": { "type": "integer" }, "created_at": { "type": "integer" }, "kind": { "$ref": "#/definitions/taskflow.FileKind" }, "name": { "type": "string" }, "size": { "type": "integer" }, "symlink_kind": { "$ref": "#/definitions/taskflow.FileKind" }, "symlink_target": { "type": "string" }, "unix_mode": { "type": "integer" }, "updated_at": { "type": "integer" }, "user": { "type": "string" } } }, "taskflow.FileKind": { "type": "string", "enum": [ "unknown", "file", "dir", "symlink" ], "x-enum-varnames": [ "FileKindUnknown", "FileKindFile", "FileKindDir", "FileKindSymlink" ] }, "taskflow.VirtualMachineStatus": { "type": "string", "enum": [ "unknown", "pending", "online", "offline", "hibernated" ], "x-enum-varnames": [ "VirtualMachineStatusUnknown", "VirtualMachineStatusPending", "VirtualMachineStatusOnline", "VirtualMachineStatusOffline", "VirtualMachineStatusHibernated" ] }, "types.ConditionStatus": { "type": "integer", "enum": [ 0, 1, 2, 3 ], "x-enum-varnames": [ "ConditionStatus_CONDITION_STATUS_UNKNOWN", "ConditionStatus_CONDITION_STATUS_IN_PROGRESS", "ConditionStatus_CONDITION_STATUS_TRUE", "ConditionStatus_CONDITION_STATUS_FALSE" ] }, "types.ConditionType": { "type": "string", "enum": [ "Scheduled", "ImagePulled", "ProjectCloned", "ImageBuilt", "ContainerCreated", "ContainerStarted", "Ready", "Failed", "Hibernated" ], "x-enum-varnames": [ "ConditionTypeScheduled", "ConditionTypeImagePulled", "ConditionTypeProjectCloned", "ConditionTypeImageBuilt", "ConditionTypeContainerCreated", "ConditionTypeContainerStarted", "ConditionTypeReady", "ConditionTypeFailed", "ConditionTypeHibernated" ] }, "web.PageInfo": { "type": "object", "properties": { "has_next_page": { "type": "boolean" }, "next_token": { "type": "string" }, "total_count": { "type": "integer" } } }, "web.Resp": { "type": "object", "properties": { "code": { "type": "integer" }, "data": {}, "message": { "type": "string" } } } } }