{"openapi":"3.0.3","info":{"title":"AgentDeploy API","description":"平台自身 API（/api/v1）。用户项目级 API 是另一套端点，版本号互不相干（规范 §5）。","version":"1.0.0"},"tags":[{"name":"platform","description":"平台自身通用端点（健康检查、能力探测）"}],"paths":{"/api/auth/*":{"get":{"operationId":"allApiAuth*"},"post":{"operationId":"allApiAuth*"},"put":{"operationId":"allApiAuth*"},"delete":{"operationId":"allApiAuth*"},"patch":{"operationId":"allApiAuth*"},"head":{"operationId":"allApiAuth*"},"options":{"operationId":"allApiAuth*"},"trace":{"operationId":"allApiAuth*"}},"/api/v1/auth/social-providers":{"get":{"summary":"已启用的第三方登录方式（未配置任何 OAUTH_* 时返回空列表）","tags":["auth"],"operationId":"getApiV1AuthSocial-providers"}},"/api/v1/auth/password-reset/status":{"get":{"summary":"是否已开启密码找回（未配 SMTP 时 enabled=false，登录页不出现入口）","tags":["auth"],"operationId":"getApiV1AuthPassword-resetStatus"}},"/api/v1/auth/social/setup-email":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"minLength":1,"maxLength":254,"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["email"],"properties":{"email":{"minLength":1,"maxLength":254,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["email"],"properties":{"email":{"minLength":1,"maxLength":254,"type":"string"}}}}}},"operationId":"postApiV1AuthSocialSetup-email"}},"/api/v1/auth/social/verify-email":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email","code"],"properties":{"email":{"minLength":1,"maxLength":254,"type":"string"},"code":{"minLength":6,"maxLength":6,"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["email","code"],"properties":{"email":{"minLength":1,"maxLength":254,"type":"string"},"code":{"minLength":6,"maxLength":6,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["email","code"],"properties":{"email":{"minLength":1,"maxLength":254,"type":"string"},"code":{"minLength":6,"maxLength":6,"type":"string"}}}}}},"operationId":"postApiV1AuthSocialVerify-email"}},"/api/oauth/jwks":{"get":{"operationId":"getApiOauthJwks"}},"/api/oauth/register":{"post":{"operationId":"postApiOauthRegister"}},"/api/oauth/authorize":{"get":{"operationId":"getApiOauthAuthorize"},"post":{"operationId":"postApiOauthAuthorize"}},"/api/oauth/token":{"post":{"operationId":"postApiOauthToken"}},"/api/oauth/userinfo":{"get":{"operationId":"getApiOauthUserinfo"}},"/api/oauth/revoke":{"post":{"operationId":"postApiOauthRevoke"}},"/api/v1/projects/{projectId}/functions":{"post":{"summary":"创建云函数（含多文件草稿源码）","tags":["functions"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","files"],"properties":{"name":{"type":"string"},"files":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["name","files"],"properties":{"name":{"type":"string"},"files":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["name","files"],"properties":{"name":{"type":"string"},"files":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}}}},"operationId":"postApiV1ProjectsByProjectIdFunctions"},"get":{"summary":"列出项目下的云函数","tags":["functions"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1ProjectsByProjectIdFunctions"}},"/api/v1/projects/{projectId}/functions/{name}":{"get":{"summary":"读取云函数草稿源码（多文件）","tags":["functions"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1ProjectsByProjectIdFunctionsByName"},"patch":{"summary":"更新云函数（重命名 / 整组替换草稿源码）","tags":["functions"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"files":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"name":{"type":"string"},"files":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"name":{"type":"string"},"files":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}}}},"operationId":"patchApiV1ProjectsByProjectIdFunctionsByName"},"delete":{"summary":"删除云函数（软删除，草稿一并清空）","tags":["functions"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"deleteApiV1ProjectsByProjectIdFunctionsByName"}},"/api/v1/projects/{projectId}/frontend/files":{"get":{"summary":"读取项目前端文件草稿（web/ 单根；存量 widgets//pages/ 键 GET 时自动迁移）","tags":["functions"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1ProjectsByProjectIdFrontendFiles"},"put":{"summary":"整组替换项目前端文件草稿（IDE 保存，幂等）","tags":["functions"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["files"],"properties":{"files":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["files"],"properties":{"files":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["files"],"properties":{"files":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}}}},"operationId":"putApiV1ProjectsByProjectIdFrontendFiles"}},"/api/v1/projects/{projectId}/shared/files":{"get":{"summary":"读取项目级共享源码（functions/_shared/** 的唯一一份）","tags":["functions"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1ProjectsByProjectIdSharedFiles"},"put":{"summary":"整组替换项目级共享源码（IDE 保存 / CLI-014 adep deploy 上传，幂等）","tags":["functions"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["files"],"properties":{"files":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["files"],"properties":{"files":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["files"],"properties":{"files":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}}}},"operationId":"putApiV1ProjectsByProjectIdSharedFiles"}},"/api/v1/projects/{projectId}/frontend/publish":{"post":{"summary":"发布项目前端工作区：生成不可变版本、切换 current 并导出静态站点","tags":["functions"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postApiV1ProjectsByProjectIdFrontendPublish"}},"/api/v1/projects/{projectId}/frontend/versions":{"get":{"summary":"列出项目前端版本（倒序）与当前版本 + 站点访问地址","tags":["functions"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1ProjectsByProjectIdFrontendVersions"}},"/api/v1/projects/{projectId}/frontend/rollback":{"post":{"summary":"回滚项目前端站点：切换到指定的既有版本并重建导出","tags":["functions"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["version"],"properties":{"version":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["version"],"properties":{"version":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["version"],"properties":{"version":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}}}}}},"operationId":"postApiV1ProjectsByProjectIdFrontendRollback"}},"/api/v1/functions/{id}/openapi":{"get":{"summary":"查询函数当前已发布版本的 OpenAPI 推导 schema（供 MCP 复用同一数据源）","tags":["functions"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1FunctionsByIdOpenapi"}},"/api/v1/projects/{projectId}/preview":{"post":{"summary":"上传前端预览产物（入口 HTML + 内容寻址模块），返回可跨浏览器打开的预览地址","tags":["preview"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["html","modules"],"properties":{"html":{"type":"string"},"modules":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"paths":{"type":"array","items":{"type":"string"}},"port":{"type":"number"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["html","modules"],"properties":{"html":{"type":"string"},"modules":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"paths":{"type":"array","items":{"type":"string"}},"port":{"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["html","modules"],"properties":{"html":{"type":"string"},"modules":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"paths":{"type":"array","items":{"type":"string"}},"port":{"type":"number"}}}}}},"operationId":"postApiV1ProjectsByProjectIdPreview"}},"/api/v1/functions/{id}/run":{"post":{"summary":"调试执行：用请求构造器触发当前草稿源码一次执行，返回模拟状态码 / 耗时 / 响应体 / 日志","tags":["functions"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"method":{"type":"string","enum":["GET","POST"]},"path":{"type":"string"},"query":{"type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}},"body":{}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"method":{"type":"string","enum":["GET","POST"]},"path":{"type":"string"},"query":{"type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}},"body":{}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"method":{"type":"string","enum":["GET","POST"]},"path":{"type":"string"},"query":{"type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}},"body":{}}}}}},"operationId":"postApiV1FunctionsByIdRun"}},"/api/v1/functions/{id}/logs":{"get":{"summary":"查询函数最近执行日志（已脱敏；M1 面板 2s 轮询拉取）","tags":["functions"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"tail","in":"query","required":false,"schema":{"type":"string"}}],"operationId":"getApiV1FunctionsByIdLogs"}},"/api/v1/projects/{projectId}/env":{"get":{"summary":"列出项目环境变量（secret 只回掩码，public 回明文）","tags":["functions"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"environment","in":"query","required":false,"schema":{"type":"string"}}],"operationId":"getApiV1ProjectsByProjectIdEnv"},"post":{"summary":"创建/更新环境变量（加密落库；secret 值写入后不可读回明文）","tags":["functions"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["environment","key","value"],"properties":{"environment":{"type":"string"},"key":{"type":"string"},"value":{"type":"string"},"isSecret":{"type":"boolean"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["environment","key","value"],"properties":{"environment":{"type":"string"},"key":{"type":"string"},"value":{"type":"string"},"isSecret":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["environment","key","value"],"properties":{"environment":{"type":"string"},"key":{"type":"string"},"value":{"type":"string"},"isSecret":{"type":"boolean"}}}}}},"operationId":"postApiV1ProjectsByProjectIdEnv"}},"/api/v1/projects/{projectId}/env/{key}":{"delete":{"summary":"删除环境变量（物理删除，立即对沙箱注入失效）","tags":["functions"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"key","in":"path","required":true,"schema":{"type":"string"}},{"name":"environment","in":"query","required":false,"schema":{"type":"string"}}],"operationId":"deleteApiV1ProjectsByProjectIdEnvByKey"}},"/api/v1/projects/{projectId}/invocations":{"get":{"summary":"项目云函数调用记录（分页 + 函数/来源/状态/时间窗过滤，最新在前）","tags":["functions"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"string"}},{"name":"pageSize","in":"query","required":false,"schema":{"type":"string"}},{"name":"functionId","in":"query","required":false,"schema":{"type":"string"}},{"name":"source","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"}}],"operationId":"getApiV1ProjectsByProjectIdInvocations"}},"/api/v1/projects/{projectId}/invocations/stats":{"get":{"summary":"项目云函数调用分析：窗口内聚合（总量/成功率/平均耗时）+ 来源分布 + Top 函数 + 时间桶序列","tags":["functions"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"functionId","in":"query","required":false,"schema":{"type":"string"}},{"name":"source","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"}},{"name":"buckets","in":"query","required":false,"schema":{"type":"string"}}],"operationId":"getApiV1ProjectsByProjectIdInvocationsStats"}},"/api/v1/projects/{projectId}/state-objects":{"get":{"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1ProjectsByProjectIdState-objects"}},"/api/v1/projects/{projectId}/state-objects/{type}/{id}":{"get":{"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"type","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1ProjectsByProjectIdState-objectsByTypeById"}},"/api/v1/projects/{projectId}/state-objects/{type}/{id}/{method}":{"post":{"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"type","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"method","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postApiV1ProjectsByProjectIdState-objectsByTypeByIdByMethod"}},"/api/v1/projects/{projectId}/triggers":{"get":{"summary":"列出项目触发器（含目标函数名）","tags":["functions"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1ProjectsByProjectIdTriggers"},"post":{"summary":"创建触发器（cron 型须带合法 cron 表达式；storage.upload 型可带 prefix 前缀过滤）","tags":["functions"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["functionId","type"],"properties":{"functionId":{"type":"string"},"type":{"type":"string"},"cron":{"type":"string"},"prefix":{"type":"string"},"enabled":{"type":"boolean"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["functionId","type"],"properties":{"functionId":{"type":"string"},"type":{"type":"string"},"cron":{"type":"string"},"prefix":{"type":"string"},"enabled":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["functionId","type"],"properties":{"functionId":{"type":"string"},"type":{"type":"string"},"cron":{"type":"string"},"prefix":{"type":"string"},"enabled":{"type":"boolean"}}}}}},"operationId":"postApiV1ProjectsByProjectIdTriggers"}},"/api/v1/projects/{projectId}/triggers/{id}":{"patch":{"summary":"启停触发器（停用即时生效：调度器每轮实时读库）","tags":["functions"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["enabled"],"properties":{"enabled":{"type":"boolean"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["enabled"],"properties":{"enabled":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["enabled"],"properties":{"enabled":{"type":"boolean"}}}}}},"operationId":"patchApiV1ProjectsByProjectIdTriggersById"},"delete":{"summary":"删除触发器（软删，调度器不再可见）","tags":["functions"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"deleteApiV1ProjectsByProjectIdTriggersById"}},"/api/v1/projects/{projectId}/triggers/runs":{"get":{"summary":"查询项目触发执行记录（触发源 / 函数版本 / 耗时 / 结果状态）","tags":["functions"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"tail","in":"query","required":false,"schema":{"type":"string"}}],"operationId":"getApiV1ProjectsByProjectIdTriggersRuns"}},"/api/v1/projects/{projectId}/deps/builtin":{"get":{"summary":"内置依赖白名单：命中者零安装直用（秒级冷启动），自定义依赖发布时装载","tags":["functions"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1ProjectsByProjectIdDepsBuiltin"}},"/api/v1/functions/{id}/deps":{"get":{"summary":"函数依赖清单状态：package.json 逐依赖标注 builtin（免安装）/ custom（发布时装载）","tags":["functions"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1FunctionsByIdDeps"}},"/api/v1/projects":{"post":{"summary":"创建项目（slug 全局唯一 + 系统域名），返回子域名地址","tags":["projects"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"slug":{"type":"string"},"spaceId":{"type":"string"},"template":{"type":"string"},"git":{"type":"object","required":["repoUrl","branch"],"properties":{"repoUrl":{"minLength":1,"type":"string"},"branch":{"minLength":1,"type":"string"},"functionRoot":{"type":"string"},"authUsername":{"type":"string"},"authToken":{"type":"string"}}}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"slug":{"type":"string"},"spaceId":{"type":"string"},"template":{"type":"string"},"git":{"type":"object","required":["repoUrl","branch"],"properties":{"repoUrl":{"minLength":1,"type":"string"},"branch":{"minLength":1,"type":"string"},"functionRoot":{"type":"string"},"authUsername":{"type":"string"},"authToken":{"type":"string"}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"slug":{"type":"string"},"spaceId":{"type":"string"},"template":{"type":"string"},"git":{"type":"object","required":["repoUrl","branch"],"properties":{"repoUrl":{"minLength":1,"type":"string"},"branch":{"minLength":1,"type":"string"},"functionRoot":{"type":"string"},"authUsername":{"type":"string"},"authToken":{"type":"string"}}}}}}}},"operationId":"postApiV1Projects"},"get":{"summary":"列出当前用户的项目","tags":["projects"],"operationId":"getApiV1Projects"}},"/api/v1/projects/{projectId}":{"get":{"summary":"读取项目详情（含子域地址与函数前缀）","tags":["projects"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1ProjectsByProjectId"},"patch":{"summary":"更新项目云函数前缀（函数公网地址随之切换，立即生效）","tags":["projects"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["functionsPrefix"],"properties":{"functionsPrefix":{"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["functionsPrefix"],"properties":{"functionsPrefix":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["functionsPrefix"],"properties":{"functionsPrefix":{"type":"string"}}}}}},"operationId":"patchApiV1ProjectsByProjectId"},"delete":{"summary":"删除项目（级联软删函数/草稿/环境变量/触发器/Git 绑定/域名，子域名立即下线）","tags":["projects"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"deleteApiV1ProjectsByProjectId"}},"/api/v1/projects/{projectId}/domains":{"post":{"summary":"绑定自定义域名：返回 CNAME 目标与一次性 TXT 校验值（pending 态）","tags":["projects"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"type":"string"}}}}}},"operationId":"postApiV1ProjectsByProjectIdDomains"},"get":{"summary":"列出项目自定义域名记录","tags":["projects"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1ProjectsByProjectIdDomains"}},"/api/v1/projects/{projectId}/domains/{domainId}/verify":{"post":{"summary":"校验域名所有权：TXT 通过后置为 verified（网关路由生效）","tags":["projects"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"domainId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postApiV1ProjectsByProjectIdDomainsByDomainIdVerify"}},"/api/v1/projects/{projectId}/domains/{domainId}":{"delete":{"summary":"解绑自定义域名（立即下线）","tags":["projects"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"domainId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"deleteApiV1ProjectsByProjectIdDomainsByDomainId"}},"/api/v1/spaces":{"get":{"summary":"列出当前用户的空间（自动保证个人空间存在）","tags":["spaces"],"operationId":"getApiV1Spaces"},"post":{"summary":"创建团队空间（创建者自动为 Owner）","tags":["spaces"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","slug"],"properties":{"name":{"type":"string"},"slug":{"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["name","slug"],"properties":{"name":{"type":"string"},"slug":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["name","slug"],"properties":{"name":{"type":"string"},"slug":{"type":"string"}}}}}},"operationId":"postApiV1Spaces"}},"/api/v1/spaces/{spaceId}":{"get":{"summary":"读取空间详情（成员可读）","tags":["spaces"],"parameters":[{"name":"spaceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1SpacesBySpaceId"}},"/api/v1/spaces/{spaceId}/members":{"get":{"summary":"列出空间成员（成员可读）","tags":["spaces"],"parameters":[{"name":"spaceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1SpacesBySpaceIdMembers"},"post":{"summary":"添加成员或调整其角色（Owner/Admin）","tags":["spaces"],"parameters":[{"name":"spaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["userId","role"],"properties":{"userId":{"type":"string"},"role":{"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["userId","role"],"properties":{"userId":{"type":"string"},"role":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["userId","role"],"properties":{"userId":{"type":"string"},"role":{"type":"string"}}}}}},"operationId":"postApiV1SpacesBySpaceIdMembers"}},"/api/v1/spaces/{spaceId}/members/{userId}":{"delete":{"summary":"移除空间成员（仅 Owner）","tags":["spaces"],"parameters":[{"name":"spaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"deleteApiV1SpacesBySpaceIdMembersByUserId"}},"/api/v1/spaces/{spaceId}/plan":{"patch":{"summary":"切换空间订阅档位（Owner/Admin）","tags":["spaces"],"parameters":[{"name":"spaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["plan"],"properties":{"plan":{"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["plan"],"properties":{"plan":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["plan"],"properties":{"plan":{"type":"string"}}}}}},"operationId":"patchApiV1SpacesBySpaceIdPlan"}},"/api/v1/spaces/{spaceId}/addons":{"post":{"summary":"加购空间资源包扩容（Owner/Admin）","tags":["spaces"],"parameters":[{"name":"spaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["dimension","amount"],"properties":{"dimension":{"type":"string"},"amount":{"type":"number"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["dimension","amount"],"properties":{"dimension":{"type":"string"},"amount":{"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["dimension","amount"],"properties":{"dimension":{"type":"string"},"amount":{"type":"number"}}}}}},"operationId":"postApiV1SpacesBySpaceIdAddons"},"get":{"summary":"列出空间资源包叠加记录（成员可读）","tags":["spaces"],"parameters":[{"name":"spaceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1SpacesBySpaceIdAddons"}},"/api/v1/spaces/{spaceId}/usage":{"get":{"summary":"读取空间当期计量用量（月度滚动窗口，成员可读）","tags":["spaces"],"parameters":[{"name":"spaceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1SpacesBySpaceIdUsage"}},"/api/v1/spaces/{spaceId}/quota":{"get":{"summary":"读取空间生效配额（两级口径，成员可读）","tags":["spaces"],"parameters":[{"name":"spaceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1SpacesBySpaceIdQuota"}},"/api/v1/billing/payment-methods":{"get":{"summary":"列出已启用支付渠道（公开目录，配置门控）","tags":["billing"],"operationId":"getApiV1BillingPayment-methods"}},"/api/v1/spaces/{spaceId}/orders":{"post":{"summary":"创建支付订单并获取支付凭证（Owner/Admin）","tags":["billing"],"parameters":[{"name":"spaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["itemType","itemCode"],"properties":{"itemType":{"type":"string"},"itemCode":{"type":"string"},"channel":{"type":"string"},"returnUrl":{"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["itemType","itemCode"],"properties":{"itemType":{"type":"string"},"itemCode":{"type":"string"},"channel":{"type":"string"},"returnUrl":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["itemType","itemCode"],"properties":{"itemType":{"type":"string"},"itemCode":{"type":"string"},"channel":{"type":"string"},"returnUrl":{"type":"string"}}}}}},"operationId":"postApiV1SpacesBySpaceIdOrders"}},"/api/v1/billing/webhook/xunhu":{"post":{"summary":"虎皮椒支付回调（签名校验，无会话）","tags":["billing"],"operationId":"postApiV1BillingWebhookXunhu"}},"/api/v1/billing/webhook/paddle":{"post":{"summary":"Paddle 支付回调（HMAC-SHA256 签名校验，无会话）","tags":["billing"],"operationId":"postApiV1BillingWebhookPaddle"}},"/api/v1/admin/stop-impersonating":{"post":{"summary":"结束模拟会话（审计回写 actor/on_behalf_of）","tags":["admin"],"operationId":"postApiV1AdminStop-impersonating"}},"/api/v1/admin/dashboard":{"get":{"summary":"管理员概览（需 super_admin）","tags":["admin"],"operationId":"getApiV1AdminDashboard"}},"/api/v1/admin/users":{"get":{"summary":"全平台用户列表 / 检索（需 super_admin）","tags":["admin"],"parameters":[{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"number"}},{"name":"offset","in":"query","required":false,"schema":{"type":"number"}}],"operationId":"getApiV1AdminUsers"}},"/api/v1/admin/users/{userId}/role":{"patch":{"summary":"调整平台角色（super_admin / user，需 super_admin）","tags":["admin"],"parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["role"],"properties":{"role":{"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["role"],"properties":{"role":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["role"],"properties":{"role":{"type":"string"}}}}}},"operationId":"patchApiV1AdminUsersByUserIdRole"}},"/api/v1/admin/users/{userId}/ban":{"post":{"summary":"禁用用户（需 super_admin）","tags":["admin"],"parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"reason":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"reason":{"type":"string"}}}}}},"operationId":"postApiV1AdminUsersByUserIdBan"}},"/api/v1/admin/users/{userId}/unban":{"post":{"summary":"启用用户（需 super_admin）","tags":["admin"],"parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postApiV1AdminUsersByUserIdUnban"}},"/api/v1/admin/users/{userId}":{"delete":{"summary":"物理删除用户及其全部数据（需 super_admin，不可逆）","tags":["admin"],"parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"deleteApiV1AdminUsersByUserId"},"patch":{"summary":"修改用户信息（姓名 / 邮箱）或重置密码（需 super_admin，审计留痕）","tags":["admin"],"parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"password":{"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"password":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"password":{"type":"string"}}}}}},"operationId":"patchApiV1AdminUsersByUserId"}},"/api/v1/admin/users/{userId}/impersonate":{"post":{"summary":"以目标用户身份模拟会话（需 super_admin，审计留痕）","tags":["admin"],"parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postApiV1AdminUsersByUserIdImpersonate"}},"/api/v1/admin/spaces":{"get":{"summary":"空间列表（含成员与项目明细）与项目占用（需 super_admin）","tags":["admin"],"operationId":"getApiV1AdminSpaces"}},"/api/v1/admin/spaces/{spaceId}/plan":{"patch":{"summary":"调整空间订阅档位（需 super_admin，审计留痕）","tags":["admin"],"parameters":[{"name":"spaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["plan"],"properties":{"plan":{"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["plan"],"properties":{"plan":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["plan"],"properties":{"plan":{"type":"string"}}}}}},"operationId":"patchApiV1AdminSpacesBySpaceIdPlan"}},"/api/v1/admin/spaces/{spaceId}/quota":{"patch":{"summary":"按维度设置空间配额叠加（需 super_admin，审计留痕）","tags":["admin"],"parameters":[{"name":"spaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["dimensions"],"properties":{"dimensions":{"type":"object","patternProperties":{"^(.*)$":{"type":"number"}}}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["dimensions"],"properties":{"dimensions":{"type":"object","patternProperties":{"^(.*)$":{"type":"number"}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["dimensions"],"properties":{"dimensions":{"type":"object","patternProperties":{"^(.*)$":{"type":"number"}}}}}}}},"operationId":"patchApiV1AdminSpacesBySpaceIdQuota"}},"/api/v1/admin/health":{"get":{"summary":"系统健康：内存 / 并发池水位 / 慢查询 Top N（需 super_admin）","tags":["admin"],"parameters":[{"name":"topN","in":"query","required":false,"schema":{"type":"number"}}],"operationId":"getApiV1AdminHealth"}},"/api/v1/admin/audit-logs":{"get":{"summary":"审计日志（只追加只读，需 super_admin）","tags":["admin"],"parameters":[{"name":"actorId","in":"query","required":false,"schema":{"type":"string"}},{"name":"onBehalfOfId","in":"query","required":false,"schema":{"type":"string"}},{"name":"targetType","in":"query","required":false,"schema":{"type":"string"}},{"name":"targetId","in":"query","required":false,"schema":{"type":"string"}},{"name":"tail","in":"query","required":false,"schema":{"type":"number"}}],"operationId":"getApiV1AdminAudit-logs"}},"/api/v1/functions/{id}/publish":{"post":{"summary":"发布函数：生成不可变版本并原子切换当前服务版本；force 可放行警告级密钥命中","tags":["functions"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["force"],"properties":{"force":{"default":false,"type":"boolean"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["force"],"properties":{"force":{"default":false,"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["force"],"properties":{"force":{"default":false,"type":"boolean"}}}}}},"operationId":"postApiV1FunctionsByIdPublish"}},"/api/v1/functions/{id}/rollback":{"post":{"summary":"回滚函数：切换到指定的既有版本（不可回滚到已裁剪版本）","tags":["functions"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["version"],"properties":{"version":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["version"],"properties":{"version":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["version"],"properties":{"version":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}}}}}},"operationId":"postApiV1FunctionsByIdRollback"}},"/api/v1/functions/{id}/versions":{"get":{"summary":"列出函数全部保留版本（倒序）与当前服务版本，含镜像引用信息（FN-015）","tags":["functions"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1FunctionsByIdVersions"}},"/api/v1/functions/{id}/builds":{"get":{"summary":"函数镜像构建历史（FN-015）：列出有镜像引用的版本记录","tags":["functions"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1FunctionsByIdBuilds"}},"/api/v1/deploy/diff":{"post":{"summary":"部署差异比对：返回需上传/发布的函数清单（CLI adep deploy 的远端比对端点）","tags":["functions"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug","functions"],"properties":{"slug":{"type":"string"},"functions":{"type":"array","items":{"type":"object","required":["name","files"],"properties":{"name":{"type":"string"},"files":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["slug","functions"],"properties":{"slug":{"type":"string"},"functions":{"type":"array","items":{"type":"object","required":["name","files"],"properties":{"name":{"type":"string"},"files":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["slug","functions"],"properties":{"slug":{"type":"string"},"functions":{"type":"array","items":{"type":"object","required":["name","files"],"properties":{"name":{"type":"string"},"files":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}}}}}}},"operationId":"postApiV1DeployDiff"}},"/api/v1/projects/{projectId}/functions/{name}/releases":{"post":{"summary":"创建灰度发布单：canary 必须是已发布版本且 ≠ 当前 stable；weight>0 即开始放量","tags":["functions"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["canaryVersion"],"properties":{"canaryVersion":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"weightPercent":{"minimum":0,"maximum":100,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"type":"integer"}]}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["canaryVersion"],"properties":{"canaryVersion":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"weightPercent":{"minimum":0,"maximum":100,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"type":"integer"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["canaryVersion"],"properties":{"canaryVersion":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"weightPercent":{"minimum":0,"maximum":100,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"type":"integer"}]}}}}}},"operationId":"postApiV1ProjectsByProjectIdFunctionsByNameReleases"},"get":{"summary":"灰度发布单列表（最新在前）+ 当前在放量的一条","tags":["functions"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1ProjectsByProjectIdFunctionsByNameReleases"}},"/api/v1/projects/{projectId}/functions/{name}/releases/{rid}":{"patch":{"summary":"调整灰度放量百分比（0 → 退回 pending，>0 → active）","tags":["functions"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}},{"name":"rid","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["weightPercent"],"properties":{"weightPercent":{"minimum":0,"maximum":100,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"type":"integer"}]}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["weightPercent"],"properties":{"weightPercent":{"minimum":0,"maximum":100,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"type":"integer"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["weightPercent"],"properties":{"weightPercent":{"minimum":0,"maximum":100,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"type":"integer"}]}}}}}},"operationId":"patchApiV1ProjectsByProjectIdFunctionsByNameReleasesByRid"}},"/api/v1/projects/{projectId}/functions/{name}/releases/{rid}/promote":{"post":{"summary":"canary 转正：publishedVersion 切到 canary，发布单进 promoted 终态","tags":["functions"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}},{"name":"rid","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postApiV1ProjectsByProjectIdFunctionsByNameReleasesByRidPromote"}},"/api/v1/projects/{projectId}/functions/{name}/releases/{rid}/rollback":{"post":{"summary":"撤销灰度：全量回 stable，publishedVersion 不变","tags":["functions"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}},{"name":"rid","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postApiV1ProjectsByProjectIdFunctionsByNameReleasesByRidRollback"}},"/api/v1/projects/{projectId}/publish-queue/submit":{"post":{"summary":"离线发布项回网入队（校验 + baseVersion 冲突预检，不产生线上版本）","tags":["functions"],"description":"需登录 + 项目空间 write 权限；payload.functionId 必须属于路径项目。批内存在冲突项时整批 409（逐项结果不连坐），冲突负载含线上当前内容（三条人工裁决路径的数据）。","parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["queueId","items"],"properties":{"queueId":{"type":"string"},"items":{"type":"array","items":{"type":"object","required":["intent","payload"],"properties":{"intent":{"type":"string"},"payload":{"type":"object","properties":{"functionId":{"type":"string"},"code":{"type":"string"},"files":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"config":{"type":"object","patternProperties":{"^(.*)$":{}}},"componentId":{"type":"string"},"content":{}}},"baseVersion":{"type":"number"}}}}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["queueId","items"],"properties":{"queueId":{"type":"string"},"items":{"type":"array","items":{"type":"object","required":["intent","payload"],"properties":{"intent":{"type":"string"},"payload":{"type":"object","properties":{"functionId":{"type":"string"},"code":{"type":"string"},"files":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"config":{"type":"object","patternProperties":{"^(.*)$":{}}},"componentId":{"type":"string"},"content":{}}},"baseVersion":{"type":"number"}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["queueId","items"],"properties":{"queueId":{"type":"string"},"items":{"type":"array","items":{"type":"object","required":["intent","payload"],"properties":{"intent":{"type":"string"},"payload":{"type":"object","properties":{"functionId":{"type":"string"},"code":{"type":"string"},"files":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"config":{"type":"object","patternProperties":{"^(.*)$":{}}},"componentId":{"type":"string"},"content":{}}},"baseVersion":{"type":"number"}}}}}}}}},"operationId":"postApiV1ProjectsByProjectIdPublish-queueSubmit"}},"/api/v1/projects/{projectId}/publish-queue/replay":{"post":{"summary":"回网重放：对已入队项走真实发布流水线（幂等，重复重放不叠加版本）","tags":["functions"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["queueId"],"properties":{"queueId":{"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["queueId"],"properties":{"queueId":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["queueId"],"properties":{"queueId":{"type":"string"}}}}}},"operationId":"postApiV1ProjectsByProjectIdPublish-queueReplay"}},"/api/v1/projects/{projectId}/publish-queue/resolve":{"post":{"summary":"冲突裁决三条人工路径：use-local（rebase 后发布）/ discard / load-cloud（返回线上当前内容）","tags":["functions"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["queueId","index","resolution"],"properties":{"queueId":{"type":"string"},"index":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"resolution":{"type":"string"},"code":{"type":"string"},"files":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["queueId","index","resolution"],"properties":{"queueId":{"type":"string"},"index":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"resolution":{"type":"string"},"code":{"type":"string"},"files":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["queueId","index","resolution"],"properties":{"queueId":{"type":"string"},"index":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"resolution":{"type":"string"},"code":{"type":"string"},"files":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}}}},"operationId":"postApiV1ProjectsByProjectIdPublish-queueResolve"}},"/api/v1/functions/{id}/mcp-publish":{"post":{"summary":"把函数发布为 MCP Tool（请求体可带 toolName / description 覆盖），立即反映到该项目 tools/list","tags":["mcp"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postApiV1FunctionsByIdMcp-publish"},"delete":{"summary":"取消发布 MCP Tool（可带 ?tool= 指定别名，缺省按函数名），立即从该项目 tools/list 移除","tags":["mcp"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"deleteApiV1FunctionsByIdMcp-publish"}},"/api/v1/projects/{projectId}/mcp/auth":{"get":{"summary":"查看项目 MCP 鉴权模式与有效 Key 列表","tags":["mcp"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1ProjectsByProjectIdMcpAuth"}},"/api/v1/projects/{projectId}/mcp/auth/audit-logs":{"get":{"summary":"读取项目 MCP 审计日志（Key 操作 + 调用，脱敏，新→旧）","tags":["mcp"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1ProjectsByProjectIdMcpAuthAudit-logs"}},"/api/v1/projects/{projectId}/mcp/auth/mode":{"put":{"summary":"设置项目 MCP 鉴权模式","tags":["mcp"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["mode"],"properties":{"mode":{"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["mode"],"properties":{"mode":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["mode"],"properties":{"mode":{"type":"string"}}}}}},"operationId":"putApiV1ProjectsByProjectIdMcpAuthMode"}},"/api/v1/projects/{projectId}/mcp/auth/keys":{"post":{"summary":"签发项目 API Key（明文仅此一次返回；存储只为摘要）","tags":["mcp"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"label":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"label":{"type":"string"}}}}}},"operationId":"postApiV1ProjectsByProjectIdMcpAuthKeys"}},"/api/v1/projects/{projectId}/mcp/auth/keys/{keyId}":{"delete":{"summary":"吊销项目 API Key（立即生效）","tags":["mcp"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"keyId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"deleteApiV1ProjectsByProjectIdMcpAuthKeysByKeyId"}},"/api/v1/projects/{projectId}/mcp/auth/keys/{keyId}/rotate":{"post":{"summary":"轮换项目 API Key（旧 secret 立即失效）","tags":["mcp"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"keyId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postApiV1ProjectsByProjectIdMcpAuthKeysByKeyIdRotate"}},"/api/v1/realtime/ticket":{"post":{"summary":"换取实时通道握手票据（一次性，60s 过期；ticket 走 Sec-WebSocket-Protocol）","tags":["realtime"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["projectId"],"properties":{"projectId":{"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["projectId"],"properties":{"projectId":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["projectId"],"properties":{"projectId":{"type":"string"}}}}}},"operationId":"postApiV1RealtimeTicket"}},"/api/v1/realtime/meter":{"get":{"summary":"查看项目实时通道计量（pushCount 按命中连接数累加；upstreamCount 为函数调用次数）","tags":["realtime"],"parameters":[{"name":"projectId","in":"query","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1RealtimeMeter"}},"/api/v1/realtime/meter/export":{"get":{"summary":"导出项目实时计量 NDJSON 行（本地文件 + 进程内 buffer）","tags":["realtime"],"parameters":[{"name":"projectId","in":"query","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1RealtimeMeterExport"}},"/api/v1/projects/{projectId}/hosting":{"get":{"summary":"获取静态托管配置与站点文件树（仅项目所有者）","tags":["storage"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1ProjectsByProjectIdHosting"},"put":{"summary":"更新静态托管配置（托管开关 / SPA 回退模式，仅项目所有者）","tags":["storage"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"spaMode":{"type":"boolean"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"spaMode":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"spaMode":{"type":"boolean"}}}}}},"operationId":"putApiV1ProjectsByProjectIdHosting"}},"/api/v1/mcp":{"post":{"summary":"平台级 MCP 端点（JSON-RPC 2.0 / 2025-06-18）","tags":["mcp"],"operationId":"postApiV1Mcp"}},"/api/v1/mcp/keys":{"get":{"summary":"列出当前用户已签发的平台 API Key","tags":["mcp"],"operationId":"getApiV1McpKeys"},"post":{"summary":"签发平台 API Key（明文仅此一次返回；绑定当前用户；可带作用域白名单）","tags":["mcp"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string"},"scopes":{"type":"object","properties":{"tools":{"type":"array","items":{"type":"string"}},"projects":{"type":"array","items":{"type":"string"}}}}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"label":{"type":"string"},"scopes":{"type":"object","properties":{"tools":{"type":"array","items":{"type":"string"}},"projects":{"type":"array","items":{"type":"string"}}}}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"label":{"type":"string"},"scopes":{"type":"object","properties":{"tools":{"type":"array","items":{"type":"string"}},"projects":{"type":"array","items":{"type":"string"}}}}}}}}},"operationId":"postApiV1McpKeys"}},"/api/v1/mcp/keys/{keyId}":{"delete":{"summary":"吊销平台 API Key（立即生效）","tags":["mcp"],"parameters":[{"name":"keyId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"deleteApiV1McpKeysByKeyId"}},"/api/v1/mcp/market/listings":{"get":{"summary":"公开市场列表（仅已上架条目，无需登录）","tags":["mcp-market"],"operationId":"getApiV1McpMarketListings"},"post":{"summary":"上架申请（需登录，提交即进审核）","tags":["mcp-market"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["projectId","name","tools"],"properties":{"projectId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"tools":{"type":"array","items":{"type":"object","required":["toolName","description"],"properties":{"toolName":{"type":"string"},"description":{"type":"string"}}}},"commissionBps":{"type":"number"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["projectId","name","tools"],"properties":{"projectId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"tools":{"type":"array","items":{"type":"object","required":["toolName","description"],"properties":{"toolName":{"type":"string"},"description":{"type":"string"}}}},"commissionBps":{"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["projectId","name","tools"],"properties":{"projectId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"tools":{"type":"array","items":{"type":"object","required":["toolName","description"],"properties":{"toolName":{"type":"string"},"description":{"type":"string"}}}},"commissionBps":{"type":"number"}}}}}},"operationId":"postApiV1McpMarketListings"}},"/api/v1/mcp/market/listings/{id}":{"get":{"summary":"上架条目详情（无需登录）","tags":["mcp-market"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1McpMarketListingsById"}},"/api/v1/mcp/market/listings/mine":{"get":{"summary":"我的上架条目（需登录）","tags":["mcp-market"],"operationId":"getApiV1McpMarketListingsMine"}},"/api/v1/mcp/market/listings/{id}/unlist":{"post":{"summary":"下架上架条目（需登录且为上架方）","tags":["mcp-market"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postApiV1McpMarketListingsByIdUnlist"}},"/api/v1/mcp/market/listings/{id}/installs":{"get":{"summary":"某上架条目的安装列表（需登录且为上架方）","tags":["mcp-market"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1McpMarketListingsByIdInstalls"}},"/api/v1/mcp/market/listings/{id}/install":{"post":{"summary":"一键接入（签发专用 API Key，明文一次性返回）","tags":["mcp-market"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postApiV1McpMarketListingsByIdInstall"}},"/api/v1/mcp/market/installs/mine":{"get":{"summary":"我的安装记录（需登录）","tags":["mcp-market"],"operationId":"getApiV1McpMarketInstallsMine"}},"/api/v1/mcp/market/installs/{id}/revoke":{"post":{"summary":"吊销安装（需登录且为订阅方，吊销即断流）","tags":["mcp-market"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postApiV1McpMarketInstallsByIdRevoke"}},"/api/v1/mcp/market/admin/listings":{"get":{"summary":"全部上架条目（含待审/已拒绝/已下架，需 super_admin）","tags":["mcp-market","admin"],"operationId":"getApiV1McpMarketAdminListings"}},"/api/v1/mcp/market/admin/listings/{id}/review":{"post":{"summary":"审核上架申请（需 super_admin）","tags":["mcp-market","admin"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["approved"],"properties":{"approved":{"type":"boolean"},"reviewNote":{"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["approved"],"properties":{"approved":{"type":"boolean"},"reviewNote":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["approved"],"properties":{"approved":{"type":"boolean"},"reviewNote":{"type":"string"}}}}}},"operationId":"postApiV1McpMarketAdminListingsByIdReview"}},"/api/v1/account/export":{"get":{"summary":"导出当前用户个人信息副本（个保法查阅复制权）","tags":["account"],"operationId":"getApiV1AccountExport"}},"/api/v1/setup/status":{"get":{"summary":"首次部署引导状态（只读，不含任何密钥）","tags":["setup"],"operationId":"getApiV1SetupStatus"}},"/api/v1/setup/check":{"post":{"operationId":"postApiV1SetupCheck"}},"/api/v1/setup/verify-token":{"post":{"operationId":"postApiV1SetupVerify-token"}},"/api/v1/setup/admin":{"post":{"operationId":"postApiV1SetupAdmin"}},"/api/v1/npm-relay/registry":{"get":{"summary":"npm 中继：白名单 registry 列表（限速）","tags":["platform","functions"],"operationId":"getApiV1Npm-relayRegistry"}},"/api/v1/npm-relay/package":{"get":{"summary":"npm 中继：解析包到可安装版本（含元数据缓存 + 限速）","tags":["platform","functions"],"parameters":[{"name":"name","in":"query","required":true,"schema":{"type":"string"}},{"name":"spec","in":"query","required":false,"schema":{"type":"string"}}],"operationId":"getApiV1Npm-relayPackage"}},"/api/v1/npm-relay/tarball":{"get":{"summary":"npm 中继：取 tarball 二进制（含缓存 + 限速）","tags":["platform","functions"],"parameters":[{"name":"name","in":"query","required":true,"schema":{"type":"string"}},{"name":"version","in":"query","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1Npm-relayTarball"}},"/api/v1/http-relay/fetch":{"post":{"summary":"HTTP 中继：代理浏览器终端 curl/wget 请求（SSRF 防护 + 限速 + 并发闸）","tags":["platform","functions"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"minLength":1,"maxLength":4096,"type":"string"},"method":{"maxLength":16,"type":"string"},"headers":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"body":{"maxLength":1048576,"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["url"],"properties":{"url":{"minLength":1,"maxLength":4096,"type":"string"},"method":{"maxLength":16,"type":"string"},"headers":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"body":{"maxLength":1048576,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["url"],"properties":{"url":{"minLength":1,"maxLength":4096,"type":"string"},"method":{"maxLength":16,"type":"string"},"headers":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"body":{"maxLength":1048576,"type":"string"}}}}}},"operationId":"postApiV1Http-relayFetch"}},"/api/v1/http-relay/stats":{"get":{"summary":"HTTP 中继聚合观测（跨访客标量，免登录只读；单实例进程内口径）","description":"只回跨全访客的聚合计数（累计 / 近一分钟请求与回传字节、拒绝与失败分类、当前与峰值并发），不含任何单用户、单项目或目标主机信息。","tags":["platform","functions"],"operationId":"getApiV1Http-relayStats"}},"/api/v1/projects/{projectId}/database":{"post":{"summary":"启动项目数据库（新建 201 / 停止后重新激活 200 / 运行中重复 409）","tags":["database"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postApiV1ProjectsByProjectIdDatabase"},"get":{"summary":"查询项目数据库状态与用量（体积 / 表数 / 行数）","tags":["database"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1ProjectsByProjectIdDatabase"},"delete":{"summary":"停止项目数据库（连接关闭并标记；文件保留）","tags":["database"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"deleteApiV1ProjectsByProjectIdDatabase"}},"/api/v1/projects/{projectId}/database/console":{"get":{"summary":"控制台概览（状态 / 用量 / 配额比例，用量卡片告警依据）","tags":["database"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1ProjectsByProjectIdDatabaseConsole"}},"/api/v1/projects/{projectId}/database/console/tables":{"get":{"summary":"控制台表列表（含每表行数）","tags":["database"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1ProjectsByProjectIdDatabaseConsoleTables"},"post":{"summary":"控制台新建表（DDL，含审计）","tags":["database"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","columns"],"properties":{"name":{"type":"string"},"columns":{"type":"array","items":{"type":"object","required":["name","type","nullable"],"properties":{"name":{"type":"string"},"type":{"type":"string"},"nullable":{"default":true,"type":"boolean"},"default":{},"unique":{"type":"boolean"},"index":{"type":"boolean"}}}},"owned":{"type":"boolean"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["name","columns"],"properties":{"name":{"type":"string"},"columns":{"type":"array","items":{"type":"object","required":["name","type","nullable"],"properties":{"name":{"type":"string"},"type":{"type":"string"},"nullable":{"default":true,"type":"boolean"},"default":{},"unique":{"type":"boolean"},"index":{"type":"boolean"}}}},"owned":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["name","columns"],"properties":{"name":{"type":"string"},"columns":{"type":"array","items":{"type":"object","required":["name","type","nullable"],"properties":{"name":{"type":"string"},"type":{"type":"string"},"nullable":{"default":true,"type":"boolean"},"default":{},"unique":{"type":"boolean"},"index":{"type":"boolean"}}}},"owned":{"type":"boolean"}}}}}},"operationId":"postApiV1ProjectsByProjectIdDatabaseConsoleTables"}},"/api/v1/projects/{projectId}/database/console/tables/{table}":{"get":{"summary":"表结构自省（字段 / 索引 / 建表 DDL，不经系统表裸通道）","tags":["database"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"table","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1ProjectsByProjectIdDatabaseConsoleTablesByTable"},"delete":{"summary":"删除表（DDL，含审计）","tags":["database"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"table","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"deleteApiV1ProjectsByProjectIdDatabaseConsoleTablesByTable"}},"/api/v1/projects/{projectId}/database/console/tables/{table}/columns":{"post":{"summary":"新增字段（DDL，含审计）","tags":["database"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"table","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","type","nullable"],"properties":{"name":{"type":"string"},"type":{"type":"string"},"nullable":{"default":true,"type":"boolean"},"default":{},"unique":{"type":"boolean"},"index":{"type":"boolean"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["name","type","nullable"],"properties":{"name":{"type":"string"},"type":{"type":"string"},"nullable":{"default":true,"type":"boolean"},"default":{},"unique":{"type":"boolean"},"index":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["name","type","nullable"],"properties":{"name":{"type":"string"},"type":{"type":"string"},"nullable":{"default":true,"type":"boolean"},"default":{},"unique":{"type":"boolean"},"index":{"type":"boolean"}}}}}},"operationId":"postApiV1ProjectsByProjectIdDatabaseConsoleTablesByTableColumns"}},"/api/v1/projects/{projectId}/database/console/tables/{table}/columns/{column}":{"delete":{"summary":"删除字段（DDL，含审计）","tags":["database"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"table","in":"path","required":true,"schema":{"type":"string"}},{"name":"column","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"deleteApiV1ProjectsByProjectIdDatabaseConsoleTablesByTableColumnsByColumn"}},"/api/v1/projects/{projectId}/database/console/tables/{table}/rows":{"get":{"summary":"数据网格分页查询（rowid 投影 + 筛选 + 排序，走受控只读通道）","tags":["database"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"table","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"string"}},{"name":"pageSize","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string"}},{"name":"filter","in":"query","required":false,"schema":{"type":"string"}}],"operationId":"getApiV1ProjectsByProjectIdDatabaseConsoleTablesByTableRows"},"post":{"summary":"数据网格新增行（走 builder 参数化插入）","tags":["database"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"table","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","patternProperties":{"^(.*)$":{}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","patternProperties":{"^(.*)$":{}}}},"multipart/form-data":{"schema":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"operationId":"postApiV1ProjectsByProjectIdDatabaseConsoleTablesByTableRows"}},"/api/v1/projects/{projectId}/database/console/tables/{table}/rows/{rowid}":{"patch":{"summary":"数据网格行内编辑（按 rowid，走 builder 参数化更新）","tags":["database"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"table","in":"path","required":true,"schema":{"type":"string"}},{"name":"rowid","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","patternProperties":{"^(.*)$":{}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","patternProperties":{"^(.*)$":{}}}},"multipart/form-data":{"schema":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"operationId":"patchApiV1ProjectsByProjectIdDatabaseConsoleTablesByTableRowsByRowid"},"delete":{"summary":"数据网格删除行（按 rowid，走 builder 参数化删除）","tags":["database"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"table","in":"path","required":true,"schema":{"type":"string"}},{"name":"rowid","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"deleteApiV1ProjectsByProjectIdDatabaseConsoleTablesByTableRowsByRowid"}},"/api/v1/projects/{projectId}/database/console/audit":{"get":{"summary":"DDL 审计日志（最近 50 条）","tags":["database"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1ProjectsByProjectIdDatabaseConsoleAudit"}},"/api/v1/projects/{projectId}/database/console/sql":{"post":{"summary":"SQL 控制台：边界内执行单条语句（含二次确认 / 截断 / 审计）","tags":["database"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sql"],"properties":{"sql":{"type":"string"},"params":{"type":"array","items":{}},"confirmTable":{"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["sql"],"properties":{"sql":{"type":"string"},"params":{"type":"array","items":{}},"confirmTable":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["sql"],"properties":{"sql":{"type":"string"},"params":{"type":"array","items":{}},"confirmTable":{"type":"string"}}}}}},"operationId":"postApiV1ProjectsByProjectIdDatabaseConsoleSql"}},"/api/v1/projects/{projectId}/database/snapshots":{"post":{"summary":"创建手动数据库快照（免费版 → 403 权益未开放）","tags":["database"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postApiV1ProjectsByProjectIdDatabaseSnapshots"},"get":{"summary":"列出项目数据库快照（按创建时间倒序）","tags":["database"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1ProjectsByProjectIdDatabaseSnapshots"}},"/api/v1/projects/{projectId}/database/snapshots/{snapshotId}/restore":{"post":{"summary":"整体还原数据库到快照时刻（付费档位；跨项目快照互不可见）","tags":["database"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"snapshotId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postApiV1ProjectsByProjectIdDatabaseSnapshotsBySnapshotIdRestore"}},"/api/v1/projects/{projectId}/database/rollback":{"post":{"summary":"时间点回滚到指定时刻（团队版；基于 __changes 变更流重放）","tags":["database"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["to"],"properties":{"to":{"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["to"],"properties":{"to":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["to"],"properties":{"to":{"type":"string"}}}}}},"operationId":"postApiV1ProjectsByProjectIdDatabaseRollback"}},"/api/v1/projects/{projectId}/files":{"post":{"summary":"上传文件（multipart；path 目标路径，visibility public|private；M1 单文件 ≤ 50MB）","tags":["storage"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postApiV1ProjectsByProjectIdFiles"},"get":{"summary":"列出项目文件（按前缀过滤；private 附签名 URL）","tags":["storage"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"prefix","in":"query","required":false,"schema":{"type":"string"}}],"operationId":"getApiV1ProjectsByProjectIdFiles"}},"/api/v1/projects/{projectId}/files/{path}":{"get":{"summary":"下载文件（public 直连；private 需签名 URL）","tags":["storage"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"path","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-expires","in":"query","required":false,"schema":{"type":"string"}},{"name":"x-signature","in":"query","required":false,"schema":{"type":"string"}}],"operationId":"getApiV1ProjectsByProjectIdFilesByPath"},"delete":{"summary":"删除文件（仅项目所有者）","tags":["storage"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"path","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"deleteApiV1ProjectsByProjectIdFilesByPath"}},"/api/v1/platform/metrics":{"get":{"summary":"平台公开聚合指标（免登录、只读，首页数据带数据源）","description":"仅返回跨全平台聚合后的标量（注册开发者数 / 本月函数调用累计 / 运行时长 / 健康态），不含单用户或单项目可识别数据；无真实出处的指标（P95 / SLA）恒为 null。","tags":["platform"],"operationId":"getApiV1PlatformMetrics"}},"/api/v1/gateway/tls-ask":{"get":{"operationId":"getApiV1GatewayTls-ask"}},"/api/v1/health":{"get":{"summary":"平台宿主运行时健康检查","description":"返回平台自身运行状态，供 e2e 与容器 healthcheck 使用。","tags":["platform"],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"operationId":"getApiV1Health"}},"/api/v1/license":{"get":{"operationId":"getApiV1License"}},"/api/v1/license/identity":{"get":{"operationId":"getApiV1LicenseIdentity"}},"/api/v1/license/gating":{"get":{"operationId":"getApiV1LicenseGating"}},"/api/v1/jobs/{id}":{"get":{"summary":"任务详情（含步骤流水）","tags":["jobs"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1JobsById"}},"/api/v1/jobs/{id}/steps":{"get":{"summary":"任务步骤流水","tags":["jobs"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1JobsByIdSteps"}},"/api/v1/jobs":{"post":{"summary":"创建长任务（排队）","tags":["jobs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["kind","steps"],"properties":{"kind":{"type":"string"},"payload":{},"steps":{"type":"array","items":{"type":"string"}},"maxAttempts":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["kind","steps"],"properties":{"kind":{"type":"string"},"payload":{},"steps":{"type":"array","items":{"type":"string"}},"maxAttempts":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["kind","steps"],"properties":{"kind":{"type":"string"},"payload":{},"steps":{"type":"array","items":{"type":"string"}},"maxAttempts":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}}}},"operationId":"postApiV1Jobs"}},"/api/v1/jobs/{id}/start":{"post":{"summary":"开始执行任务","tags":["jobs"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postApiV1JobsByIdStart"}},"/api/v1/jobs/{id}/suspend":{"post":{"summary":"挂起任务（记录原因）","tags":["jobs"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["reason"],"properties":{"reason":{"type":"string"},"runAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"message":{"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["reason"],"properties":{"reason":{"type":"string"},"runAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"message":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["reason"],"properties":{"reason":{"type":"string"},"runAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"message":{"type":"string"}}}}}},"operationId":"postApiV1JobsByIdSuspend"}},"/api/v1/jobs/{id}/resume":{"post":{"summary":"恢复被挂起的任务","tags":["jobs"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postApiV1JobsByIdResume"}},"/api/v1/jobs/{id}/cancel":{"post":{"summary":"取消任务","tags":["jobs"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"reason":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"reason":{"type":"string"}}}}}},"operationId":"postApiV1JobsByIdCancel"}},"/api/v1/notifications":{"get":{"summary":"列出当前用户的站内通知","tags":["notify"],"parameters":[{"name":"category","in":"query","required":false,"schema":{"type":"string"}}],"operationId":"getApiV1Notifications"}},"/api/v1/notifications/{id}/read":{"patch":{"summary":"标记通知为已读","tags":["notify"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"patchApiV1NotificationsByIdRead"}},"/api/v1/templates":{"get":{"summary":"已启用预设模板清单","tags":["src"],"operationId":"getApiV1Templates"}},"/api/v1/templates/{code}/package":{"get":{"summary":"下载模板包（脚手架文件集）","tags":["src"],"parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1TemplatesByCodePackage"},"put":{"summary":"上传模板包（管理面，需登录）","tags":["src"],"parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","version","manifest","files"],"properties":{"code":{"type":"string"},"version":{"type":"string"},"manifest":{},"files":{"type":"array","items":{"type":"object","required":["path","content"],"properties":{"path":{"type":"string"},"content":{"type":"string"}}}}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["code","version","manifest","files"],"properties":{"code":{"type":"string"},"version":{"type":"string"},"manifest":{},"files":{"type":"array","items":{"type":"object","required":["path","content"],"properties":{"path":{"type":"string"},"content":{"type":"string"}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["code","version","manifest","files"],"properties":{"code":{"type":"string"},"version":{"type":"string"},"manifest":{},"files":{"type":"array","items":{"type":"object","required":["path","content"],"properties":{"path":{"type":"string"},"content":{"type":"string"}}}}}}}}},"operationId":"putApiV1TemplatesByCodePackage"}},"/api/v1/projects/{projectId}/gitsync":{"get":{"summary":"读取项目 Git 绑定（源码是否由外部仓库托管）","tags":["src"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1ProjectsByProjectIdGitsync"},"delete":{"summary":"解绑项目 Git 仓库（confirmed=true 二次确认）","tags":["src"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"confirmed","in":"query","required":false,"schema":{"type":"string"}}],"operationId":"deleteApiV1ProjectsByProjectIdGitsync"}},"/api/v1/projects/{projectId}/gitsync/bind":{"post":{"summary":"绑定/更新项目 Git 仓库（浅层 clone 校验连通性，支持私有仓库凭据）","tags":["src"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["repoUrl","branch"],"properties":{"repoUrl":{"minLength":1,"type":"string"},"branch":{"minLength":1,"type":"string"},"functionRoot":{"type":"string"},"syncEnabled":{"type":"boolean"},"authUsername":{"type":"string"},"authToken":{"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["repoUrl","branch"],"properties":{"repoUrl":{"minLength":1,"type":"string"},"branch":{"minLength":1,"type":"string"},"functionRoot":{"type":"string"},"syncEnabled":{"type":"boolean"},"authUsername":{"type":"string"},"authToken":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["repoUrl","branch"],"properties":{"repoUrl":{"minLength":1,"type":"string"},"branch":{"minLength":1,"type":"string"},"functionRoot":{"type":"string"},"syncEnabled":{"type":"boolean"},"authUsername":{"type":"string"},"authToken":{"type":"string"}}}}}},"operationId":"postApiV1ProjectsByProjectIdGitsyncBind"}},"/api/v1/gitsync/webhook":{"post":{"summary":"Git push webhook（签名校验后触发同步/部署）","tags":["src"],"operationId":"postApiV1GitsyncWebhook"}},"/api/v1/projects/{projectId}/gitsync/sync":{"post":{"summary":"手动触发一次 Git 同步 + 自动部署（本地无 webhook 可达时用）","tags":["src"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postApiV1ProjectsByProjectIdGitsyncSync"}},"/api/v1/projects/{projectId}/ai":{"post":{"summary":"AI 立项（仅限已 Git 绑定项目）：建 kind=ai 的 JOB 任务并启动引擎","description":"已废弃（FE-042）：由 IDE AI 助手（ai-develop 步骤链）取代，见模块注释。","tags":["ai"],"deprecated":true,"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["goal"],"properties":{"goal":{"minLength":1,"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["goal"],"properties":{"goal":{"minLength":1,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["goal"],"properties":{"goal":{"minLength":1,"type":"string"}}}}}},"operationId":"postApiV1ProjectsByProjectIdAi"}},"/api/v1/projects/{projectId}/ai/runs":{"get":{"summary":"AI 运行历史（最新在前）","description":"已废弃（FE-042）：由 IDE AI 助手（ai-develop 步骤链）取代，见模块注释。","tags":["ai"],"deprecated":true,"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1ProjectsByProjectIdAiRuns"}},"/api/v1/projects/{projectId}/ai/runs/{runId}":{"get":{"summary":"AI 运行详情（JOB 状态 + 引擎循环态）","description":"已废弃（FE-042）：由 IDE AI 助手（ai-develop 步骤链）取代，见模块注释。","tags":["ai"],"deprecated":true,"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"runId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1ProjectsByProjectIdAiRunsByRunId"}},"/api/v1/projects/{projectId}/ai/runs/{runId}/pause":{"post":{"summary":"暂停 AI 运行（引擎 + JOB 双向联动）","description":"已废弃（FE-042）：由 IDE AI 助手（ai-develop 步骤链）取代，见模块注释。","tags":["ai"],"deprecated":true,"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"runId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postApiV1ProjectsByProjectIdAiRunsByRunIdPause"}},"/api/v1/projects/{projectId}/ai/runs/{runId}/resume":{"post":{"summary":"恢复 AI 运行（引擎 + JOB 双向联动）","description":"已废弃（FE-042）：由 IDE AI 助手（ai-develop 步骤链）取代，见模块注释。","tags":["ai"],"deprecated":true,"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"runId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postApiV1ProjectsByProjectIdAiRunsByRunIdResume"}},"/api/v1/projects/{projectId}/ai/provider":{"put":{"summary":"设置 / 清空项目 AI 提供方配置（缺任一要素即清空，AI-002）","tags":["ai"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"apiHost":{"type":"string"},"apiKey":{"type":"string"},"model":{"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"apiHost":{"type":"string"},"apiKey":{"type":"string"},"model":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"apiHost":{"type":"string"},"apiKey":{"type":"string"},"model":{"type":"string"}}}}}},"operationId":"putApiV1ProjectsByProjectIdAiProvider"},"get":{"summary":"AI 提供方状态（host / model + key 掩码，无明文 key，AI-002）","tags":["ai"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1ProjectsByProjectIdAiProvider"}},"/api/v1/projects/{projectId}/ai/ide-turn":{"post":{"summary":"Web IDE 单回合推理代理（解密项目 AI 配置 → 调一次模型 → 回 content + toolCalls）","description":"无状态：不执行工具、不落库。工具的执行与结果回灌发生在浏览器（IDE 内核命令总线）。","tags":["ai"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["messages","tools"],"properties":{"messages":{"minItems":1,"maxItems":80,"type":"array","items":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","enum":["system","user","assistant","tool"]},"content":{"maxLength":16000,"type":"string"},"toolCallId":{"type":"string"},"toolCalls":{"type":"array","items":{"type":"object","required":["id","name","arguments"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"arguments":{"type":"string"}}}}}}},"tools":{"maxItems":96,"type":"array","items":{"type":"object","required":["name","description","parameters"],"properties":{"name":{"minLength":1,"type":"string"},"description":{"type":"string"},"parameters":{"additionalProperties":true,"type":"object","properties":{}}}}}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["messages","tools"],"properties":{"messages":{"minItems":1,"maxItems":80,"type":"array","items":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","enum":["system","user","assistant","tool"]},"content":{"maxLength":16000,"type":"string"},"toolCallId":{"type":"string"},"toolCalls":{"type":"array","items":{"type":"object","required":["id","name","arguments"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"arguments":{"type":"string"}}}}}}},"tools":{"maxItems":96,"type":"array","items":{"type":"object","required":["name","description","parameters"],"properties":{"name":{"minLength":1,"type":"string"},"description":{"type":"string"},"parameters":{"additionalProperties":true,"type":"object","properties":{}}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["messages","tools"],"properties":{"messages":{"minItems":1,"maxItems":80,"type":"array","items":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","enum":["system","user","assistant","tool"]},"content":{"maxLength":16000,"type":"string"},"toolCallId":{"type":"string"},"toolCalls":{"type":"array","items":{"type":"object","required":["id","name","arguments"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"arguments":{"type":"string"}}}}}}},"tools":{"maxItems":96,"type":"array","items":{"type":"object","required":["name","description","parameters"],"properties":{"name":{"minLength":1,"type":"string"},"description":{"type":"string"},"parameters":{"additionalProperties":true,"type":"object","properties":{}}}}}}}}}},"operationId":"postApiV1ProjectsByProjectIdAiIde-turn"}},"/api/v1/agent/chat":{"post":{"summary":"/agent 对话回合（LLM + 平台 MCP 工具编排，应答含逐步工具调用记录）","tags":["ai"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["projectId","messages"],"properties":{"projectId":{"minLength":1,"type":"string"},"messages":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","enum":["user","assistant"]},"content":{"minLength":1,"maxLength":4000,"type":"string"}}}},"widgets":{"maxItems":20,"type":"array","items":{"minLength":1,"maxLength":64,"type":"string"}}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["projectId","messages"],"properties":{"projectId":{"minLength":1,"type":"string"},"messages":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","enum":["user","assistant"]},"content":{"minLength":1,"maxLength":4000,"type":"string"}}}},"widgets":{"maxItems":20,"type":"array","items":{"minLength":1,"maxLength":64,"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["projectId","messages"],"properties":{"projectId":{"minLength":1,"type":"string"},"messages":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","enum":["user","assistant"]},"content":{"minLength":1,"maxLength":4000,"type":"string"}}}},"widgets":{"maxItems":20,"type":"array","items":{"minLength":1,"maxLength":64,"type":"string"}}}}}}},"operationId":"postApiV1AgentChat"}},"/api/v1/tickets":{"get":{"summary":"工单列表（按项目 + 可选状态）","tags":["ai"],"parameters":[{"name":"projectId","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["open","answered","expired","cancelled"]}}],"operationId":"getApiV1Tickets"}},"/api/v1/tickets/{id}":{"get":{"summary":"工单详情（结构化 fields）","tags":["ai"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1TicketsById"}},"/api/v1/tickets/{id}/answer":{"post":{"summary":"填答工单（结构化答复）→ answered + 可选恢复 JOB","tags":["ai"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["values"],"properties":{"values":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["values"],"properties":{"values":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["values"],"properties":{"values":{"type":"object","patternProperties":{"^(.*)$":{}}}}}}}},"operationId":"postApiV1TicketsByIdAnswer"}},"/api/v1/projects/{projectId}/export":{"post":{"summary":"触发应用导出（长任务，立即返回 job）","tags":["appexport"],"description":"需项目所属空间 manage 权限。withData=true 时带数据库行数据；源码默认随包导出，withoutSource=true 出纯产物包。返回体 progress 为 0~100 的整数百分比。","parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"withData":{"type":"boolean"},"withSource":{"type":"boolean"},"withoutSource":{"type":"boolean"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"withData":{"type":"boolean"},"withSource":{"type":"boolean"},"withoutSource":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"withData":{"type":"boolean"},"withSource":{"type":"boolean"},"withoutSource":{"type":"boolean"}}}}}},"operationId":"postApiV1ProjectsByProjectIdExport"}},"/api/v1/exports/{jobId}":{"get":{"summary":"导出任务进度（read 权限，按项目所属空间判定）","tags":["appexport"],"parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1ExportsByJobId"}},"/api/v1/exports/{jobId}/download":{"get":{"summary":"导出产物签名下载 URL（15 分钟有效）","tags":["appexport"],"parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1ExportsByJobIdDownload"}},"/api/v1/growth/invite/code":{"post":{"summary":"签发我的邀请码（幂等，每用户唯一一码，全局唯一、不过期）","tags":["growth"],"description":"重复调用返回同一个码。新用户注册时在 sign-up 请求体携带 `inviteCode` 即建立邀请关系（CORE-026）。","operationId":"postApiV1GrowthInviteCode"}},"/api/v1/growth/invite/list":{"get":{"summary":"我的邀请列表与上限进度（status: pending_bind / linked / rewarded）","tags":["growth"],"operationId":"getApiV1GrowthInviteList"}},"/api/v1/growth/points":{"get":{"summary":"我的积分余额与流水（发生时间倒序，分页；余额恒等于流水净额）","tags":["growth"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"string"}},{"name":"offset","in":"query","required":false,"schema":{"type":"string"}}],"operationId":"getApiV1GrowthPoints"}},"/api/v1/growth/redeem":{"post":{"summary":"积分兑换（functionCalls → 空间资源包；balance 见 redeem-options 可用性）","tags":["growth"],"description":"requestId 是幂等键：同一 requestId 重试只扣一次分、只发一次资源包。扣积分与发放资源包在同一事务内，失败整体回滚（不留半账）。","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["channel","requestId","quantity"],"properties":{"channel":{"minLength":1,"type":"string"},"requestId":{"minLength":8,"maxLength":64,"type":"string"},"spaceId":{"minLength":1,"type":"string"},"quantity":{"type":"number"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["channel","requestId","quantity"],"properties":{"channel":{"minLength":1,"type":"string"},"requestId":{"minLength":8,"maxLength":64,"type":"string"},"spaceId":{"minLength":1,"type":"string"},"quantity":{"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["channel","requestId","quantity"],"properties":{"channel":{"minLength":1,"type":"string"},"requestId":{"minLength":8,"maxLength":64,"type":"string"},"spaceId":{"minLength":1,"type":"string"},"quantity":{"type":"number"}}}}}},"operationId":"postApiV1GrowthRedeem"}},"/api/v1/growth/redeem-options":{"get":{"summary":"兑换比例与通道可用性（配置为运行时真相源）","tags":["growth"],"operationId":"getApiV1GrowthRedeem-options"}},"/api/v1/wallet/balance":{"get":{"summary":"我的余额与流水（分；余额恒等于流水净额，只读自己）","tags":["wallet"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"string"}},{"name":"offset","in":"query","required":false,"schema":{"type":"string"}}],"operationId":"getApiV1WalletBalance"}},"/api/v1/marketplace":{"get":{"summary":"应用市场公开列表（q 搜索 / tags 过滤 / sort=newest|likes）","tags":["marketplace"],"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"tags","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"string"}},{"name":"offset","in":"query","required":false,"schema":{"type":"string"}}],"operationId":"getApiV1Marketplace"},"post":{"summary":"上架/更新我的项目分享（同一项目幂等更新）","tags":["marketplace"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["projectId","title"],"properties":{"projectId":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"forkPrice":{"type":"number"},"downloadPrice":{"type":"number"},"forkWithEnv":{"type":"boolean"},"status":{"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["projectId","title"],"properties":{"projectId":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"forkPrice":{"type":"number"},"downloadPrice":{"type":"number"},"forkWithEnv":{"type":"boolean"},"status":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["projectId","title"],"properties":{"projectId":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"forkPrice":{"type":"number"},"downloadPrice":{"type":"number"},"forkWithEnv":{"type":"boolean"},"status":{"type":"string"}}}}}},"operationId":"postApiV1Marketplace"}},"/api/v1/marketplace/mine":{"get":{"summary":"我的上架列表（含已下架）","tags":["marketplace"],"operationId":"getApiV1MarketplaceMine"}},"/api/v1/marketplace/{id}":{"get":{"summary":"市场条目详情（作者、积分价、互动状态）","tags":["marketplace"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getApiV1MarketplaceById"}},"/api/v1/marketplace/{id}/like":{"post":{"summary":"点赞 / 取消点赞（toggle）","tags":["marketplace"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postApiV1MarketplaceByIdLike"}},"/api/v1/marketplace/{id}/fork":{"post":{"summary":"Fork：扣积分（>0 时）→ 深拷贝项目到我的空间","tags":["marketplace"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postApiV1MarketplaceByIdFork"}},"/api/v1/marketplace/{id}/download":{"post":{"summary":"下载源码包（扣积分 >0 时）→ 签名 URL（10 分钟有效）","tags":["marketplace"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postApiV1MarketplaceByIdDownload"}},"/api/v1/admin/marketplace/{id}/template":{"post":{"summary":"管理员把市场共享应用固定为创建项目模板（super_admin）","tags":["marketplace","admin"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postApiV1AdminMarketplaceByIdTemplate"}}},"components":{"schemas":{"HealthResponse":{"type":"object","required":["status","runtime","timestamp"],"properties":{"status":{"const":"ok","type":"string"},"runtime":{"type":"string"},"timestamp":{"type":"string"},"instanceId":{"type":"string"}},"$id":"#/components/schemas/HealthResponse","additionalProperties":false},"ErrorEnvelope":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","traceId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"traceId":{"type":"string"}}}},"$id":"#/components/schemas/ErrorEnvelope","additionalProperties":false}}}}