{
 "openapi": "3.1.0",
 "info": {
  "title": "cfapi.aog.cc 公开接口契约",
  "version": "1.10.113",
  "description": "面向外部开发者与插件作者的最小完整契约：只包含公开与插件接口，且所有 JSON 请求体都有 schema。内部运维接口不在此文件内，也不承诺兼容；完整清单见 /api/openapi.json（内部操作标记 internal-admin-generic）。",
  "contact": {
   "name": "cfapi.aog.cc",
   "url": "https://cfapi.aog.cc"
  }
 },
 "servers": [
  {
   "url": "https://cfapi.aog.cc",
   "description": "生产网关"
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer",
    "bearerFormat": "JWT"
   }
  },
  "schemas": {
   "ApiError": {
    "type": "object",
    "properties": {
     "code": {
      "type": "integer",
      "example": 40100
     },
     "message": {
      "type": "string",
      "example": "登录已过期或无效，请重新登录"
     },
     "data": {
      "type": "null"
     }
    }
   },
   "LoginReq": {
    "type": "object",
    "required": [
     "username",
     "password"
    ],
    "properties": {
     "username": {
      "type": "string",
      "example": "admin"
     },
     "password": {
      "type": "string",
      "example": "admin888888"
     }
    }
   },
   "LoginResult": {
    "type": "object",
    "properties": {
     "token": {
      "type": "string"
     },
     "user": {
      "$ref": "#/components/schemas/AdminUser"
     },
     "permissions": {
      "type": "array",
      "items": {
       "type": "string"
      }
     }
    }
   },
   "AdminUser": {
    "type": "object",
    "properties": {
     "id": {
      "type": "integer"
     },
     "username": {
      "type": "string"
     },
     "nickname": {
      "type": "string"
     },
     "email": {
      "type": [
       "string",
       "null"
      ]
     },
     "phone": {
      "type": [
       "string",
       "null"
      ]
     },
     "department_id": {
      "type": "integer"
     },
     "status": {
      "type": "integer",
      "description": "1=启用 0=禁用"
     },
     "is_super": {
      "type": "integer",
      "description": "1=超级管理员"
     }
    }
   },
   "AppUser": {
    "type": "object",
    "properties": {
     "id": {
      "type": "integer"
     },
     "username": {
      "type": "string"
     },
     "nickname": {
      "type": "string"
     },
     "email": {
      "type": [
       "string",
       "null"
      ]
     },
     "phone": {
      "type": [
       "string",
       "null"
      ]
     },
     "status": {
      "type": "integer"
     }
    }
   },
   "Role": {
    "type": "object",
    "properties": {
     "id": {
      "type": "integer"
     },
     "name": {
      "type": "string"
     },
     "code": {
      "type": "string"
     },
     "description": {
      "type": [
       "string",
       "null"
      ]
     },
     "status": {
      "type": "integer"
     }
    }
   },
   "Permission": {
    "type": "object",
    "properties": {
     "id": {
      "type": "integer"
     },
     "name": {
      "type": "string"
     },
     "code": {
      "type": "string"
     },
     "category": {
      "type": "string"
     },
     "description": {
      "type": [
       "string",
       "null"
      ]
     }
    }
   },
   "Department": {
    "type": "object",
    "properties": {
     "id": {
      "type": "integer"
     },
     "parent_id": {
      "type": "integer"
     },
     "name": {
      "type": "string"
     },
     "sort": {
      "type": "integer"
     },
     "status": {
      "type": "integer"
     }
    }
   },
   "Plugin": {
    "type": "object",
    "description": "插件注册记录。manifest 为 plugin.json 原始内容（含菜单/权限/入口）。",
    "properties": {
     "id": {
      "type": "integer"
     },
     "code": {
      "type": "string",
      "example": "demo"
     },
     "name": {
      "type": "string"
     },
     "version": {
      "type": "string"
     },
     "ptype": {
      "type": "string",
      "enum": [
       "local",
       "remote"
      ]
     },
     "base_url": {
      "type": "string",
      "description": "插件后端地址；local 无后端可留空"
     },
     "status": {
      "type": "integer",
      "description": "1=启用 0=停用"
     },
     "manifest": {
      "type": "string",
      "description": "plugin.json 原文(JSON 字符串)"
     }
    }
   },
   "PluginManifest": {
    "type": "object",
    "description": "插件清单 plugin.json。上传安装时 code 必须与 query code 一致；type 为登记标签，wasm/sandbox 执行需另建 active 沙箱配置。",
    "required": [
     "code"
    ],
    "properties": {
     "code": {
      "type": "string",
      "pattern": "^[a-z0-9_]{1,64}$",
      "description": "仅小写字母、数字、下划线，1-64 位"
     },
     "name": {
      "type": "string"
     },
     "version": {
      "type": "string",
      "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"
     },
     "type": {
      "type": "string",
      "enum": [
       "local",
       "remote",
       "wasm",
       "sandbox",
       "disabled"
      ],
      "default": "local"
     },
     "base_url": {
      "type": "string",
      "maxLength": 512,
      "description": "remote 必填；非超管提交禁止内网/回环地址"
     },
     "description": {
      "type": "string"
     },
     "entry": {
      "type": "string",
      "description": "相对入口；禁止绝对路径与 ..。local 静态入口固定 index.html，entry 不改变页面入口。"
     },
     "permissions": {
      "type": "array",
      "items": {
       "type": "string",
       "pattern": "^(\\*|[A-Za-z0-9_.:-]+)$"
      },
      "default": [],
      "description": "权限声明。可用平台权限码（如 plugin.view）或 resource:action。上传路径不强制冒号；/api/manifest/scan 更严格。声明不等于授权。"
     },
     "dependencies": {
      "type": "array",
      "items": {
       "type": "object",
       "required": [
        "plugin"
       ],
       "properties": {
        "plugin": {
         "type": "string",
         "pattern": "^[a-z0-9_]+$"
        },
        "version": {
         "type": "string",
         "default": "*"
        },
        "optional": {
         "type": "boolean",
         "default": false
        }
       }
      }
     },
     "requirements": {
      "type": "object",
      "properties": {
       "memory_mb": {
        "type": "integer",
        "minimum": 0
       },
       "cpu_shares": {
        "type": "integer",
        "minimum": 0
       },
       "disk_mb": {
        "type": "integer",
        "minimum": 0
       },
       "features": {
        "type": "array",
        "items": {
         "type": "string"
        }
       }
      },
      "default": {
       "memory_mb": 64,
       "cpu_shares": 100,
       "disk_mb": 10,
       "features": []
      }
     },
     "icon": {
      "type": "string"
     },
     "menu": {
      "type": "object",
      "properties": {
       "title": {
        "type": "string"
       },
       "path": {
        "type": "string"
       },
       "permission": {
        "type": "string"
       }
      }
     }
    },
    "additionalProperties": true
   },
   "MarketEntry": {
    "type": "object",
    "description": "市场目录中的单个插件条目。type=remote 仅登记 base_url（零文件操作）；type=local 从 download_url 拉包落地（市场策展地址，非用户任意 URL）。",
    "properties": {
     "code": {
      "type": "string",
      "example": "demo_remote"
     },
     "name": {
      "type": "string"
     },
     "version": {
      "type": "string"
     },
     "description": {
      "type": "string"
     },
     "type": {
      "type": "string",
      "enum": [
       "local",
       "remote"
      ]
     },
     "base_url": {
      "type": "string",
      "description": "remote 类型插件后端域名"
     },
     "download_url": {
      "type": "string",
      "description": "local 类型插件包地址（市场策展，可信）"
     },
     "author": {
      "type": "string"
     },
     "logo": {
      "type": "string"
     }
    }
   },
   "MarketInstallReq": {
    "type": "object",
    "required": [
     "code"
    ],
    "properties": {
     "code": {
      "type": "string",
      "description": "市场目录中的插件 code（小写字母/数字/下划线）"
     }
    }
   },
   "PluginTokenReq": {
    "type": "object",
    "required": [
     "scopes"
    ],
    "properties": {
     "scopes": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "minItems": 1
     },
     "ttl": {
      "type": "integer",
      "minimum": 60,
      "maximum": 2592000,
      "default": 3600,
      "description": "秒；缺省 3600"
     }
    }
   },
   "PluginTokenVerifyReq": {
    "type": "object",
    "required": [
     "token"
    ],
    "properties": {
     "token": {
      "type": "string"
     }
    }
   },
   "PluginUserRegisterReq": {
    "type": "object",
    "required": [
     "username",
     "password"
    ],
    "properties": {
     "username": {
      "type": "string"
     },
     "password": {
      "type": "string",
      "format": "password"
     },
     "email": {
      "type": "string"
     },
     "display_name": {
      "type": "string"
     }
    }
   },
   "PluginUserLoginReq": {
    "type": "object",
    "required": [
     "username",
     "password"
    ],
    "properties": {
     "username": {
      "type": "string"
     },
     "password": {
      "type": "string",
      "format": "password"
     }
    }
   },
   "PluginAiChatReq": {
    "type": "object",
    "required": [
     "messages"
    ],
    "properties": {
     "provider": {
      "type": "string"
     },
     "model": {
      "type": "string"
     },
     "messages": {
      "type": "array",
      "items": {
       "type": "object"
      }
     },
     "max_tokens": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "PluginKvPutReq": {
    "type": "object",
    "required": [
     "value"
    ],
    "properties": {
     "value": {
      "description": "任意 JSON 值"
     },
     "ttl_secs": {
      "type": "integer",
      "minimum": 1,
      "description": "过期秒数；缺省或 0 表示永不过期"
     }
    }
   },
   "PluginPaymentReq": {
    "type": "object",
    "required": [
     "amount_micros"
    ],
    "properties": {
     "user_id": {
      "type": "integer"
     },
     "amount_micros": {
      "type": "integer",
      "minimum": 1
     },
     "currency": {
      "type": "string",
      "default": "CNY"
     },
     "description": {
      "type": "string"
     }
    }
   },
   "PluginPushReq": {
    "type": "object",
    "required": [
     "event",
     "data"
    ],
    "properties": {
     "room": {
      "type": "string"
     },
     "event": {
      "type": "string"
     },
     "data": {
      "description": "任意 JSON 值"
     }
    }
   },
   "PluginRoomReq": {
    "type": "object",
    "required": [
     "room"
    ],
    "properties": {
     "room": {
      "type": "string"
     },
     "description": {
      "type": "string"
     }
    }
   },
   "UiSlotReq": {
    "type": "object",
    "required": [
     "slot_name"
    ],
    "properties": {
     "slot_name": {
      "type": "string"
     },
     "plugin_code": {
      "type": "string",
      "description": "管理端创建时必填；插件自管理时由路径 code 覆盖"
     },
     "title": {
      "type": "string"
     },
     "config_json": {
      "description": "任意 JSON 配置"
     },
     "sort_order": {
      "type": "integer",
      "default": 0
     },
     "enabled": {
      "type": "integer",
      "enum": [
       0,
       1
      ],
      "default": 1
     }
    }
   },
   "HookRegisterReq": {
    "type": "object",
    "required": [
     "event_name",
     "callback_url"
    ],
    "properties": {
     "event_name": {
      "type": "string"
     },
     "callback_url": {
      "type": "string"
     },
     "secret": {
      "type": "string",
      "default": ""
     },
     "is_active": {
      "type": "integer",
      "enum": [
       0,
       1
      ],
      "default": 1
     },
     "timeout_ms": {
      "type": "integer",
      "default": 10000
     },
     "retry_count": {
      "type": "integer",
      "default": 2
     }
    }
   },
   "RpcGrantReq": {
    "type": "object",
    "required": [
     "caller_code",
     "target_code",
     "method"
    ],
    "properties": {
     "caller_code": {
      "type": "string"
     },
     "target_code": {
      "type": "string"
     },
     "method": {
      "type": "string",
      "description": "子路径；* 表示全部"
     }
    }
   },
   "RpcCallReq": {
    "type": "object",
    "required": [
     "target"
    ],
    "properties": {
     "target": {
      "type": "string"
     },
     "method": {
      "type": "string",
      "description": "目标子路径/方法名，必须命中显式 RPC 授权"
     },
     "payload": {
      "description": "任意 JSON，作为请求体转交目标"
     }
    }
   },
   "SchedulerCreateReq": {
    "type": "object",
    "required": [
     "schedule_type",
     "schedule_value",
     "callback_url"
    ],
    "properties": {
     "schedule_type": {
      "type": "string",
      "enum": [
       "interval",
       "cron",
       "daily"
      ]
     },
     "schedule_value": {
      "type": "string",
      "description": "interval: 秒数；cron: 表达式；daily: HH:MM"
     },
     "callback_url": {
      "type": "string"
     }
    }
   },
   "SchedulerUpdateReq": {
    "type": "object",
    "properties": {
     "schedule_type": {
      "type": "string",
      "enum": [
       "interval",
       "cron",
       "daily"
      ]
     },
     "schedule_value": {
      "type": "string"
     },
     "callback_url": {
      "type": "string"
     },
     "enabled": {
      "type": "integer",
      "enum": [
       0,
       1
      ]
     }
    }
   },
   "JobEnqueueReq": {
    "type": "object",
    "properties": {
     "plugin_code": {
      "type": "string"
     },
     "job_type": {
      "type": "string",
      "default": "http"
     },
     "job_name": {
      "type": "string"
     },
     "dedupe_key": {
      "type": "string"
     },
     "payload": {
      "description": "任意 JSON"
     },
     "target_url": {
      "type": "string"
     },
     "priority": {
      "type": "integer"
     },
     "max_attempts": {
      "type": "integer"
     },
     "run_at": {
      "type": "string",
      "description": "YYYY-MM-DD HH:MM:SS 或 ISO；now/空表示立即"
     }
    }
   },
   "DataStorePutReq": {
    "type": "object",
    "required": [
     "value"
    ],
    "properties": {
     "namespace": {
      "type": "string",
      "default": "default"
     },
     "value": {
      "type": "string",
      "description": "字符串值（按源码为 String）"
     }
    }
   },
   "MarketRatingReq": {
    "type": "object",
    "required": [
     "plugin_code",
     "rating"
    ],
    "properties": {
     "plugin_code": {
      "type": "string"
     },
     "rating": {
      "type": "integer",
      "minimum": 1,
      "maximum": 5
     },
     "comment": {
      "type": "string",
      "maxLength": 512
     }
    }
   },
   "MarketReviewReq": {
    "type": "object",
    "properties": {
     "notes": {
      "type": "string"
     }
    }
   },
   "PluginConfigSchema": {
    "type": "object",
    "required": [
     "fields"
    ],
    "properties": {
     "fields": {
      "type": "array",
      "items": {
       "type": "object",
       "required": [
        "key",
        "type",
        "label"
       ],
       "properties": {
        "key": {
         "type": "string"
        },
        "type": {
         "type": "string",
         "enum": [
          "string",
          "number",
          "boolean",
          "password",
          "url",
          "select"
         ]
        },
        "label": {
         "type": "string"
        },
        "default": {},
        "required": {
         "type": "boolean"
        },
        "placeholder": {
         "type": "string"
        },
        "options": {
         "type": "array",
         "items": {
          "type": "object",
          "required": [
           "label",
           "value"
          ],
          "properties": {
           "label": {
            "type": "string"
           },
           "value": {
            "type": "string"
           }
          }
         }
        },
        "min": {
         "type": "number"
        },
        "max": {
         "type": "number"
        },
        "description": {
         "type": "string"
        }
       }
      }
     }
    }
   },
   "UpdateProfileReq": {
    "type": "object",
    "properties": {
     "username": {
      "type": "string"
     },
     "nickname": {
      "type": "string"
     },
     "email": {
      "type": "string"
     },
     "phone": {
      "type": "string"
     }
    }
   },
   "CreateApiKeyReq": {
    "type": "object",
    "properties": {
     "label": {
      "type": "string"
     },
     "scopes": {
      "type": "string",
      "description": "逗号/空格分隔的 scope，默认 *；仍不能高于账号权限"
     },
     "expires_hours": {
      "type": "integer",
      "description": "0 或省略表示不过期"
     },
     "tier": {
      "type": "string",
      "enum": [
       "external",
       "internal",
       "internal_advanced"
      ],
      "description": "请求层级；服务端会收敛到不高于归属账号"
     }
    }
   },
   "InterPluginCallReq": {
    "type": "object",
    "properties": {
     "method": {
      "type": "string",
      "default": "POST"
     },
     "body": {
      "description": "转交给目标插件的 JSON"
     },
     "headers": {
      "type": "object",
      "additionalProperties": {
       "type": "string"
      }
     }
    }
   },
   "WebhookInboxReq": {
    "type": "object",
    "required": [
     "source",
     "event_type",
     "payload"
    ],
    "properties": {
     "source": {
      "type": "string",
      "maxLength": 64
     },
     "event_type": {
      "type": "string",
      "maxLength": 64
     },
     "payload": {
      "description": "任意 JSON，最大 256 KiB"
     },
     "secret": {
      "type": "string"
     }
    }
   },
   "PublicPluginDocReq": {
    "type": "object",
    "required": [
     "captcha_token",
     "captcha_answer"
    ],
    "description": "业务字段直接平铺在顶层，另加验证码字段；不是 { data: {...} } 包装。",
    "additionalProperties": true,
    "properties": {
     "captcha_token": {
      "type": "string"
     },
     "captcha_answer": {
      "type": "string"
     }
    }
   },
   "OpenAIChatReq": {
    "type": "object",
    "required": [
     "model",
     "messages"
    ],
    "properties": {
     "model": {
      "type": "string"
     },
     "messages": {
      "type": "array",
      "items": {
       "type": "object"
      }
     },
     "temperature": {
      "type": "number"
     },
     "max_tokens": {
      "type": "integer"
     },
     "stream": {
      "type": "boolean"
     }
    },
    "additionalProperties": true
   },
   "AnthropicMessagesReq": {
    "type": "object",
    "required": [
     "model",
     "messages",
     "max_tokens"
    ],
    "properties": {
     "model": {
      "type": "string"
     },
     "messages": {
      "type": "array",
      "items": {
       "type": "object"
      }
     },
     "max_tokens": {
      "type": "integer"
     },
     "system": {
      "type": "string"
     },
     "stream": {
      "type": "boolean"
     }
    },
    "additionalProperties": true
   },
   "PublicAiReportReq": {
    "type": "object",
    "description": "报告字段直接平铺在顶层，另加可选验证码。",
    "additionalProperties": true,
    "properties": {
     "captcha_token": {
      "type": "string"
     },
     "captcha_answer": {
      "type": "string"
     }
    }
   },
   "ErrorResponse": {
    "type": "object",
    "description": "所有失败响应的统一结构。HTTP 状态码表达传输层语义，code 表达业务语义，两者不可互相替代。",
    "required": [
     "code",
     "message"
    ],
    "properties": {
     "code": {
      "type": "integer",
      "description": "业务码：40000 参数错误 / 40100 未认证 / 40300 无权限 / 40400 不存在 / 40900 冲突 / 42900 限流 / 50000 内部错误 / 50300 暂不可用"
     },
     "message": {
      "type": "string",
      "description": "可直接展示给用户的中文说明；不要依赖其字面内容做程序分支"
     },
     "data": {
      "description": "失败时固定为 null",
      "type": [
       "object",
       "null"
      ]
     }
    },
    "example": {
     "code": 40300,
     "message": "缺少权限: plugin.manage",
     "data": null
    }
   }
  },
  "responses": {
   "Unauthorized": {
    "description": "未认证（40100）",
    "content": {
     "application/json": {
      "example": {
       "code": 40100,
       "message": "登录已过期或无效，请重新登录",
       "data": null
      },
      "schema": {
       "$ref": "#/components/schemas/ErrorResponse"
      }
     }
    }
   },
   "Forbidden": {
    "description": "无权限（40300）",
    "content": {
     "application/json": {
      "example": {
       "code": 40300,
       "message": "缺少权限: dashboard.view",
       "data": null
      },
      "schema": {
       "$ref": "#/components/schemas/ErrorResponse"
      }
     }
    }
   },
   "BadRequest": {
    "description": "参数错误（40000）",
    "content": {
     "application/json": {
      "example": {
       "code": 40000,
       "message": "密码长度需为 6-64 个字符",
       "data": null
      },
      "schema": {
       "$ref": "#/components/schemas/ErrorResponse"
      }
     }
    }
   },
   "Conflict": {
    "description": "冲突（40900）",
    "content": {
     "application/json": {
      "example": {
       "code": 40900,
       "message": "用户名已存在",
       "data": null
      },
      "schema": {
       "$ref": "#/components/schemas/ErrorResponse"
      }
     }
    }
   },
   "TooManyRequests": {
    "description": "触发限流（42900）。按 IP 或账号维度的滑动窗口，额度由后台设置决定；请退避重试，不要换密钥硬刷。",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/ErrorResponse"
      },
      "example": {
       "code": 42900,
       "message": "请求过于频繁，请稍后再试",
       "data": null
      }
     }
    }
   },
   "InternalError": {
    "description": "服务端内部错误（50000）。响应不会回显内部细节，请凭时间点与请求 ID 报障。",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/ErrorResponse"
      },
      "example": {
       "code": 50000,
       "message": "服务器内部错误",
       "data": null
      }
     }
    }
   },
   "ServiceUnavailable": {
    "description": "服务暂不可用（50300），通常是升级/限流保护/依赖不可达。",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/ErrorResponse"
      },
      "example": {
       "code": 50300,
       "message": "服务暂不可用，请稍后重试",
       "data": null
      }
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "tags": [
  {
   "name": "Anthropic 兼容接口",
   "description": "兼容 Anthropic 协议的模型调用"
  },
  {
   "name": "OpenAI 兼容接口",
   "description": "兼容 OpenAI 协议的模型调用"
  },
  {
   "name": "OpenRouter 兼容接口",
   "description": "兼容 OpenRouter 协议的模型调用"
  },
  {
   "name": "事件总线",
   "description": "事件发布与投递"
  },
  {
   "name": "云函数",
   "description": "函数的部署、调用与日志"
  },
  {
   "name": "代理转发",
   "description": "反向代理规则与访问日志"
  },
  {
   "name": "仪表盘",
   "description": "首页汇总数据"
  },
  {
   "name": "任务队列",
   "description": "异步任务的投递、重试与查询"
  },
  {
   "name": "信用评分",
   "description": "插件与开发者信用分"
  },
  {
   "name": "健康检查",
   "description": "存活探针"
  },
  {
   "name": "公开接口",
   "description": "无需登录即可访问的公共数据"
  },
  {
   "name": "分账结算",
   "description": "结算单生成与执行"
  },
  {
   "name": "升级服务",
   "description": "版本检查与升级包分发"
  },
  {
   "name": "协议网关",
   "description": "图数据、长连接、实时通道开关"
  },
  {
   "name": "单点登录（SAML）",
   "description": "SAML 2.0 身份提供方对接"
  },
  {
   "name": "可观测性",
   "description": "监控指标、熔断器与告警"
  },
  {
   "name": "后台用户管理",
   "description": "管理员对用户的增删改查与角色分配"
  },
  {
   "name": "商品",
   "description": "售卖商品定义"
  },
  {
   "name": "回调通知",
   "description": "第三方回调接收"
  },
  {
   "name": "备份与恢复",
   "description": "数据库与文件备份、还原"
  },
  {
   "name": "多语言",
   "description": "语言包与翻译条目"
  },
  {
   "name": "安全扫描",
   "description": "插件包与依赖的安全检测"
  },
  {
   "name": "应用注册",
   "description": "终端应用注册与登记"
  },
  {
   "name": "开放授权",
   "description": "OAuth 2.0 授权码、令牌、内省与客户端管理"
  },
  {
   "name": "持续集成部署",
   "description": "代码仓库配置、流水线与运行记录"
  },
  {
   "name": "接口密钥",
   "description": "密钥签发与层级授权"
  },
  {
   "name": "接口层级权限",
   "description": "内部/外部双层级能力白名单、插件审批与快照回滚"
  },
  {
   "name": "接口文档",
   "description": "在线接口浏览器"
  },
  {
   "name": "接口文档",
   "description": "接口规范文件"
  },
  {
   "name": "控制台配置",
   "description": "后台站点标题、菜单与外观"
  },
  {
   "name": "插件事件内核",
   "description": "事件钩子、界面插槽与内核扩展点"
  },
  {
   "name": "插件对象存储管理",
   "description": "存储桶、对象与访问策略"
  },
  {
   "name": "插件对象存储（面向插件）",
   "description": "插件运行时可直接调用的对象存储接口"
  },
  {
   "name": "插件市场",
   "description": "插件上架、审核、评分与安装"
  },
  {
   "name": "插件数据存储",
   "description": "插件专属集合、文档与键值存储"
  },
  {
   "name": "插件沙箱",
   "description": "受限执行环境的配置与运行记录"
  },
  {
   "name": "插件清单",
   "description": "清单解析与权限声明"
  },
  {
   "name": "插件管理",
   "description": "插件的安装、启用、代理转发与市场分发"
  },
  {
   "name": "支付意图",
   "description": "支付单创建与确认"
  },
  {
   "name": "数据同步",
   "description": "多端数据同步与冲突解决"
  },
  {
   "name": "数据库管理",
   "description": "表结构浏览与在线查询"
  },
  {
   "name": "数据清理",
   "description": "按类别清理历史数据"
  },
  {
   "name": "构建与分发",
   "description": "客户端构建目标、证书、构建任务与产物"
  },
  {
   "name": "版本信息",
   "description": "服务版本号"
  },
  {
   "name": "用户中心",
   "description": "面向终端用户的账户接口"
  },
  {
   "name": "用户管理",
   "description": "用户的增删改查与状态"
  },
  {
   "name": "用量计量",
   "description": "调用量统计与配额"
  },
  {
   "name": "签名公证",
   "description": "公钥管理与内容签名校验"
  },
  {
   "name": "系统管理",
   "description": "系统信息、在线升级与运行状态"
  },
  {
   "name": "系统设置",
   "description": "键值型全局配置"
  },
  {
   "name": "网站转应用",
   "description": "把网站打包为多平台客户端"
  },
  {
   "name": "自有应用打包",
   "description": "自有应用的多端构建"
  },
  {
   "name": "角色与权限",
   "description": "角色、权限点与部门"
  },
  {
   "name": "计费与账单",
   "description": "订阅、用量、发票与收入"
  },
  {
   "name": "认证登录",
   "description": "登录、登出、资料与密码"
  },
  {
   "name": "身份与访问控制",
   "description": "租户、属性策略、权限委派与远程调用授权"
  },
  {
   "name": "运维操作",
   "description": "命令日志与运维动作"
  },
  {
   "name": "钩子链",
   "description": "钩子的注册、启停与测试"
  },
  {
   "name": "链路追踪",
   "description": "调用链与风险日志"
  },
  {
   "name": "风险控制",
   "description": "风险评估、事件与人工解除"
  },
  {
   "name": "公共",
   "description": "无需登录的公开端点（版本、健康检查、验证码）。"
  },
  {
   "name": "认证",
   "description": "登录、登出、资料与改密。平台不提供公开的开发者自助注册接口，账号由管理员创建。"
  },
  {
   "name": "后台账号",
   "description": "后台管理员账号的增删改查与状态管理，需管理类权限。"
  },
  {
   "name": "角色权限",
   "description": "RBAC 角色、权限点与部门维护。"
  },
  {
   "name": "部门",
   "description": "组织架构与部门归属。"
  },
  {
   "name": "业务用户",
   "description": "前台业务用户（应用侧账号）的注册、登录与管理，与插件自有用户不是同一套体系。"
  },
  {
   "name": "插件",
   "description": "插件注册、上传、启停、归属、分类、代理与数据面。"
  },
  {
   "name": "系统",
   "description": "系统信息、升级与运维状态，权限最高。"
  }
 ],
 "x-devcenter-docs": {
  "docs_version": "2026.11.05-r1",
  "human": "/docs/devcenter/",
  "ai_index": "/docs/devcenter/llms.txt",
  "ai_full": "/docs/devcenter/llms-full.txt",
  "manifest_schema": "/docs/devcenter/schemas/plugin-manifest.schema.json",
  "retired_extra": "/docs/devcenter/openapi_extra.json"
 },
 "paths": {
  "/api/health": {
   "get": {
    "tags": [
     "公共"
    ],
    "summary": "健康检查",
    "security": [],
    "responses": {
     "200": {
      "description": "ok"
     }
    },
    "parameters": [],
    "operationId": "get_api_health"
   }
  },
  "/api/version": {
   "get": {
    "tags": [
     "公共"
    ],
    "summary": "系统版本信息",
    "security": [],
    "responses": {
     "200": {
      "description": "版本",
      "content": {
       "application/json": {
        "example": {
         "code": 0,
         "message": "ok",
         "data": {
          "name": "cfapi.aog.cc",
          "version": "1.10.109"
         }
        }
       }
      }
     }
    },
    "parameters": [],
    "operationId": "get_api_version"
   }
  },
  "/api/openapi.json": {
   "get": {
    "tags": [
     "公共"
    ],
    "summary": "本文件（机器可读接口契约）",
    "security": [],
    "responses": {
     "200": {
      "description": "OpenAPI 3.1 JSON"
     }
    },
    "parameters": [],
    "operationId": "get_api_openapi_json"
   }
  },
  "/api/auth/login": {
   "post": {
    "tags": [
     "认证"
    ],
    "summary": "登录获取 token",
    "security": [],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/LoginReq"
       },
       "example": {
        "username": "dev_user",
        "password": "your-password"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "example": {
         "code": 0,
         "message": "ok",
         "data": {
          "token": "eyJ...",
          "user": {
           "id": 1,
           "username": "admin",
           "is_super": 1
          },
          "permissions": [
           "dashboard.view"
          ]
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    },
    "parameters": [],
    "operationId": "post_api_auth_login"
   }
  },
  "/api/auth/logout": {
   "post": {
    "tags": [
     "认证"
    ],
    "summary": "退出登录（客户端丢弃 token 即可）",
    "responses": {
     "200": {
      "description": "ok"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    },
    "parameters": [],
    "operationId": "post_api_auth_logout"
   }
  },
  "/api/auth/profile": {
   "get": {
    "tags": [
     "认证"
    ],
    "summary": "当前登录账号与权限",
    "responses": {
     "200": {
      "description": "ok",
      "content": {
       "application/json": {
        "example": {
         "code": 0,
         "message": "ok",
         "data": {
          "user": {
           "id": 1,
           "username": "admin"
          },
          "permissions": [
           "dashboard.view"
          ],
          "role_ids": [
           1
          ]
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    },
    "parameters": [],
    "operationId": "get_api_auth_profile"
   },
   "put": {
    "tags": [
     "认证登录"
    ],
    "summary": "认证登录：更新个人资料",
    "description": "更新当前账号资料。昵称/邮箱/电话可选，用户名变更需未被占用。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/UpdateProfileReq"
       }
      }
     }
    },
    "parameters": [],
    "operationId": "put_api_auth_profile"
   }
  },
  "/api/auth/change-password": {
   "post": {
    "tags": [
     "认证"
    ],
    "summary": "修改当前账号密码",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "old_password": {
          "type": "string"
         },
         "new_password": {
          "type": "string"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "ok"
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     }
    },
    "parameters": [],
    "operationId": "post_api_auth_change_password"
   }
  },
  "/api/app/register": {
   "post": {
    "tags": [
     "业务用户"
    ],
    "summary": "开放注册（受 ALLOW_APP_REGISTER 开关控制）",
    "security": [],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "username": {
          "type": "string"
         },
         "password": {
          "type": "string"
         },
         "nickname": {
          "type": "string"
         },
         "email": {
          "type": "string"
         },
         "phone": {
          "type": "string"
         }
        }
       },
       "example": {
        "username": "dev_user",
        "password": "your-password",
        "nickname": "开发者",
        "email": "dev@example.com"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "ok"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     }
    },
    "parameters": [],
    "operationId": "post_api_app_register"
   }
  },
  "/api/plugins": {
   "get": {
    "tags": [
     "插件"
    ],
    "summary": "插件列表（需 plugin.view）",
    "responses": {
     "200": {
      "description": "ok",
      "content": {
       "application/json": {
        "example": {
         "code": 0,
         "message": "ok",
         "data": [
          {
           "id": 1,
           "code": "demo",
           "name": "示例",
           "ptype": "local",
           "status": 1
          }
         ]
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    },
    "parameters": [],
    "operationId": "get_api_plugins"
   },
   "post": {
    "tags": [
     "插件"
    ],
    "summary": "注册/更新插件（需 plugin.manage），body 为 PluginManifest",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PluginManifest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "ok"
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     }
    },
    "parameters": [],
    "x-required-permission": "plugin.manage",
    "operationId": "post_api_plugins"
   }
  },
  "/api/plugins/upload": {
   "post": {
    "tags": [
     "插件"
    ],
    "summary": "后台上传插件 zip 包（需 plugin.manage）。Query ?code={code}，Body 为 application/zip 原始二进制。自动解压到 /plugins/{code}/ 并读取 plugin.json 注册。",
    "parameters": [
     {
      "name": "code",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "ok"
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     }
    },
    "x-required-permission": "plugin.manage",
    "operationId": "post_api_plugins_upload"
   }
  },
  "/api/plugins/scan": {
   "post": {
    "tags": [
     "插件"
    ],
    "summary": "扫描插件目录，把已解压未注册的插件批量注册（需 plugin.manage）",
    "responses": {
     "200": {
      "description": "ok",
      "content": {
       "application/json": {
        "example": {
         "code": 0,
         "message": "ok",
         "data": {
          "installed": 1,
          "skipped": []
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    },
    "parameters": [],
    "x-required-permission": "plugin.manage",
    "operationId": "post_api_plugins_scan"
   }
  },
  "/api/plugins/market": {
   "get": {
    "tags": [
     "插件"
    ],
    "summary": "插件市场目录（需 plugin.view）。返回可一键安装的插件清单(items)，source=builtin 表示使用内置目录、remote 表示来自 PLUGIN_MARKET_URL 配置的市场服务。",
    "responses": {
     "200": {
      "description": "ok",
      "content": {
       "application/json": {
        "example": {
         "code": 0,
         "message": "ok",
         "data": {
          "items": [
           {
            "code": "demo_remote",
            "name": "示例·远程插件",
            "version": "1.10.109",
            "type": "remote",
            "base_url": "https://cfapi.aog.cc",
            "description": "其他服务器 API"
           }
          ],
          "source": "builtin"
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    },
    "parameters": [],
    "operationId": "get_api_plugins_market"
   }
  },
  "/api/plugins/market/install": {
   "post": {
    "tags": [
     "插件"
    ],
    "summary": "从插件市场一键安装（需 plugin.manage）。remote 类型零文件操作瞬时登记 base_url；local 类型从市场策展 download_url 拉包落地。",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/MarketInstallReq"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "ok"
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "404": {
      "$ref": "#/components/responses/Conflict"
     }
    },
    "parameters": [],
    "operationId": "post_api_plugins_market_install"
   }
  },
  "/api/plugins/{code}": {
   "get": {
    "tags": [
     "插件"
    ],
    "summary": "插件详情（需 plugin.view）",
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "ok",
      "content": {
       "application/json": {
        "example": {
         "code": 0,
         "message": "ok",
         "data": {
          "code": "demo",
          "name": "示例",
          "ptype": "local",
          "manifest": "{\"code\":\"demo\",\"menu\":{\"title\":\"示例\"}}"
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    },
    "x-required-permission": "plugin.view",
    "operationId": "get_api_plugins_code"
   },
   "delete": {
    "tags": [
     "插件"
    ],
    "summary": "卸载插件（需 plugin.manage，local 会清理本地目录）",
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "ok"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    },
    "x-required-permission": "plugin.manage",
    "operationId": "delete_api_plugins_code"
   }
  },
  "/api/plugins/{code}/enable": {
   "post": {
    "tags": [
     "插件"
    ],
    "summary": "启用插件（需 plugin.manage）",
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "ok"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    },
    "x-required-permission": "plugin.manage",
    "operationId": "post_api_plugins_code_enable"
   }
  },
  "/api/plugins/{code}/disable": {
   "post": {
    "tags": [
     "插件"
    ],
    "summary": "停用插件（需 plugin.manage）",
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "ok"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    },
    "x-required-permission": "plugin.manage",
    "operationId": "post_api_plugins_code_disable"
   }
  },
  "/api/plugins/{code}/proxy/{tail}": {
   "get": {
    "tags": [
     "插件"
    ],
    "summary": "插件鉴权网关转发（需 plugin.view）。使用 X-Platform-Signature 按插件专属密钥签名转发到 base_url。",
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "tail",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "转发到插件后端的子路径"
     }
    ],
    "responses": {
     "200": {
      "description": "插件响应"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    },
    "x-required-permission": "plugin.view",
    "description": "平台鉴权反向代理，仅 remote + base_url 可用。读方法需要 plugin.view，写方法需要 plugin.manage。平台注入 X-Platform-Signature / X-Platform-Caller-Signature（按插件派生密钥，推荐校验）、旧 X-Platform-Token（平台全局密钥，仅为兼容，外部插件不应依赖）以及租户/调用者头；同时剥离调用者 Authorization/Cookie/x-api-key/x-auth-token。响应上限 16 MB，默认超时 15 秒。",
    "operationId": "get_api_plugins_code_proxy_tail"
   },
   "post": {
    "tags": [
     "插件"
    ],
    "summary": "插件 API 转发(POST)",
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "tail",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "转发到插件后端的子路径"
     }
    ],
    "responses": {
     "200": {
      "description": "插件响应"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    },
    "x-required-permission": "plugin.manage",
    "description": "平台鉴权反向代理，仅 remote + base_url 可用。读方法需要 plugin.view，写方法需要 plugin.manage。平台注入 X-Platform-Signature / X-Platform-Caller-Signature（按插件派生密钥，推荐校验）、旧 X-Platform-Token（平台全局密钥，仅为兼容，外部插件不应依赖）以及租户/调用者头；同时剥离调用者 Authorization/Cookie/x-api-key/x-auth-token。响应上限 16 MB，默认超时 15 秒。",
    "operationId": "post_api_plugins_code_proxy_tail"
   },
   "put": {
    "tags": [
     "插件"
    ],
    "summary": "插件 API 转发(PUT)",
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "tail",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "转发到插件后端的子路径"
     }
    ],
    "responses": {
     "200": {
      "description": "插件响应"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    },
    "x-required-permission": "plugin.manage",
    "description": "平台鉴权反向代理，仅 remote + base_url 可用。读方法需要 plugin.view，写方法需要 plugin.manage。平台注入 X-Platform-Signature / X-Platform-Caller-Signature（按插件派生密钥，推荐校验）、旧 X-Platform-Token（平台全局密钥，仅为兼容，外部插件不应依赖）以及租户/调用者头；同时剥离调用者 Authorization/Cookie/x-api-key/x-auth-token。响应上限 16 MB，默认超时 15 秒。",
    "operationId": "put_api_plugins_code_proxy_tail"
   },
   "delete": {
    "tags": [
     "插件"
    ],
    "summary": "插件 API 转发(DELETE)",
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "tail",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "转发到插件后端的子路径"
     }
    ],
    "responses": {
     "200": {
      "description": "插件响应"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     }
    },
    "x-required-permission": "plugin.manage",
    "description": "平台鉴权反向代理，仅 remote + base_url 可用。读方法需要 plugin.view，写方法需要 plugin.manage。平台注入 X-Platform-Signature / X-Platform-Caller-Signature（按插件派生密钥，推荐校验）、旧 X-Platform-Token（平台全局密钥，仅为兼容，外部插件不应依赖）以及租户/调用者头；同时剥离调用者 Authorization/Cookie/x-api-key/x-auth-token。响应上限 16 MB，默认超时 15 秒。",
    "operationId": "delete_api_plugins_code_proxy_tail"
   }
  },
  "/api/anthropic/v1/messages": {
   "post": {
    "tags": [
     "Anthropic 兼容接口"
    ],
    "summary": "Anthropic 兼容接口：创建消息",
    "description": "Anthropic Messages 兼容入口，按用户限流与计量；插件内调用优先使用 /api/plugins/{code}/ai/chat。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AnthropicMessagesReq"
       }
      }
     }
    },
    "parameters": [],
    "operationId": "post_api_anthropic_v1_messages"
   }
  },
  "/api/auth/captcha": {
   "get": {
    "tags": [
     "认证登录"
    ],
    "summary": "认证登录：查询图形验证码",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/auth/captcha`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [],
    "operationId": "get_api_auth_captcha"
   }
  },
  "/api/events": {
   "get": {
    "tags": [
     "事件总线"
    ],
    "summary": "事件总线：查询列表",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/events`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [],
    "operationId": "get_api_events"
   }
  },
  "/api/health/plugins": {
   "get": {
    "tags": [
     "健康检查"
    ],
    "summary": "健康检查：查询 plugins",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/health/plugins`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [],
    "operationId": "get_api_health_plugins"
   }
  },
  "/api/market/captcha": {
   "get": {
    "tags": [
     "插件市场"
    ],
    "summary": "插件市场：查询图形验证码",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/market/captcha`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [],
    "x-required-permission": "public",
    "operationId": "get_api_market_captcha"
   }
  },
  "/api/market/catalog": {
   "get": {
    "tags": [
     "插件市场"
    ],
    "summary": "插件市场：查询目录",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/market/catalog`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [],
    "x-required-permission": "authenticated",
    "operationId": "get_api_market_catalog"
   }
  },
  "/api/market/categories": {
   "get": {
    "tags": [
     "插件市场"
    ],
    "summary": "插件市场：查询分类",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/market/categories`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [],
    "x-required-permission": "authenticated",
    "operationId": "get_api_market_categories"
   }
  },
  "/api/market/plugins/{code}/unpublish": {
   "post": {
    "tags": [
     "插件市场"
    ],
    "summary": "插件市场：创建 unpublish（按 code 定位）",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/market/plugins/{code}/unpublish`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "x-required-permission": "plugin.govern",
    "operationId": "post_api_market_plugins_code_unpublish"
   }
  },
  "/api/market/ratings": {
   "post": {
    "tags": [
     "插件市场"
    ],
    "summary": "插件市场：创建评分",
    "description": "为已上架插件评分（1–5）。需要有效登录身份。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/MarketRatingReq"
       }
      }
     }
    },
    "parameters": [],
    "x-required-permission": "authenticated",
    "operationId": "post_api_market_ratings"
   }
  },
  "/api/market/ratings/{plugin_code}": {
   "get": {
    "tags": [
     "插件市场"
    ],
    "summary": "评分：按 plugin_code 获取详情",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/market/ratings/{plugin_code}`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "plugin_code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：plugin_code"
     }
    ],
    "x-required-permission": "authenticated",
    "operationId": "get_api_market_ratings_plugin_code"
   }
  },
  "/api/market/submissions": {
   "get": {
    "tags": [
     "插件市场"
    ],
    "summary": "插件市场：查询提交记录",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/market/submissions`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [],
    "x-required-permission": "authenticated",
    "operationId": "get_api_market_submissions"
   }
  },
  "/api/market/submissions/{id}/approve": {
   "post": {
    "tags": [
     "插件市场"
    ],
    "summary": "插件市场：执行批准（按 id 定位）",
    "description": "批准市场提交。需要 plugin.govern；危险扫描项默认阻断，只有 query force=1 才强制通过。批准不安装、不启用、不部署。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "force",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean"
      },
      "description": "危险扫描项强制批准，仅限治理人员复核后使用"
     }
    ],
    "x-required-permission": "plugin.govern",
    "operationId": "post_api_market_submissions_id_approve"
   }
  },
  "/api/market/submissions/{id}/reject": {
   "post": {
    "tags": [
     "插件市场"
    ],
    "summary": "插件市场：执行驳回（按 id 定位）",
    "description": "驳回市场提交，可写 notes。需要 plugin.govern。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "路径参数：记录标识"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/MarketReviewReq"
       }
      }
     }
    },
    "x-required-permission": "plugin.govern",
    "operationId": "post_api_market_submissions_id_reject"
   }
  },
  "/api/market/submit": {
   "post": {
    "tags": [
     "插件市场"
    ],
    "summary": "插件市场：执行提交",
    "description": "提交市场审核。任意有效登录用户可用，不要求 plugin.manage；版本必须 x.y.z 且高于该插件历史最高上架版本；每用户每分钟最多 3 次。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "plugin_code",
         "name",
         "download_url",
         "captcha_token",
         "captcha_answer"
        ],
        "properties": {
         "plugin_code": {
          "type": "string",
          "pattern": "^[a-z0-9_]{1,64}$"
         },
         "name": {
          "type": "string"
         },
         "version": {
          "type": "string",
          "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$",
          "default": "1.0.0"
         },
         "description": {
          "type": "string"
         },
         "author": {
          "type": "string"
         },
         "email": {
          "type": "string"
         },
         "download_url": {
          "type": "string",
          "maxLength": 1024
         },
         "documentation_url": {
          "type": "string"
         },
         "category": {
          "type": "string"
         },
         "tags": {
          "type": "string",
          "description": "逗号分隔"
         },
         "captcha_token": {
          "type": "string"
         },
         "captcha_answer": {
          "type": "string"
         }
        }
       },
       "example": {
        "plugin_code": "demo_plugin",
        "name": "示例插件",
        "version": "1.0.0",
        "description": "一句话说明插件做什么",
        "download_url": "/api/market/uploads/demo_plugin.zip",
        "category": "工具",
        "tags": "示例,工具",
        "captcha_token": "<GET /api/market/captcha 返回的 token>",
        "captcha_answer": "41"
       }
      }
     }
    },
    "parameters": [],
    "x-required-permission": "authenticated",
    "operationId": "post_api_market_submit"
   }
  },
  "/api/market/uploads/{filename}": {
   "get": {
    "tags": [
     "插件市场"
    ],
    "summary": "uploads：按 filename 获取详情",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/market/uploads/{filename}`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "filename",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：filename"
     }
    ],
    "x-required-permission": "public",
    "operationId": "get_api_market_uploads_filename"
   }
  },
  "/api/market/versions/{id}/set-current": {
   "post": {
    "tags": [
     "插件市场"
    ],
    "summary": "插件市场：创建 set current（按 id 定位）",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/market/versions/{id}/set-current`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "路径参数：记录标识"
     }
    ],
    "x-required-permission": "plugin.govern",
    "operationId": "post_api_market_versions_id_set_current"
   }
  },
  "/api/market/versions/{plugin_code}": {
   "get": {
    "tags": [
     "插件市场"
    ],
    "summary": "versions：按 plugin_code 获取详情",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/market/versions/{plugin_code}`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "plugin_code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：plugin_code"
     }
    ],
    "x-required-permission": "authenticated",
    "operationId": "get_api_market_versions_plugin_code"
   }
  },
  "/api/openai/v1/chat/completions": {
   "post": {
    "tags": [
     "OpenAI 兼容接口"
    ],
    "summary": "OpenAI 兼容接口：创建补全",
    "description": "OpenAI 兼容的对话补全入口，按用户限流与计量；插件内调用优先使用 /api/plugins/{code}/ai/chat。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/OpenAIChatReq"
       }
      }
     }
    },
    "parameters": [],
    "operationId": "post_api_openai_v1_chat_completions"
   }
  },
  "/api/openai/v1/models": {
   "get": {
    "tags": [
     "OpenAI 兼容接口"
    ],
    "summary": "OpenAI 兼容接口：查询模型列表",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/openai/v1/models`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [],
    "operationId": "get_api_openai_v1_models"
   }
  },
  "/api/plugin-data/docs": {
   "get": {
    "tags": [
     "插件数据存储"
    ],
    "summary": "插件数据存储：查询文档",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugin-data/docs`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [],
    "operationId": "get_api_plugin_data_docs"
   }
  },
  "/api/plugin-data/docs/{id}": {
   "delete": {
    "tags": [
     "插件数据存储"
    ],
    "summary": "文档：按 id 删除",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugin-data/docs/{id}`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "路径参数：记录标识"
     }
    ],
    "operationId": "delete_api_plugin_data_docs_id"
   }
  },
  "/api/plugin-data/kv": {
   "get": {
    "tags": [
     "插件数据存储"
    ],
    "summary": "插件数据存储：查询键值",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugin-data/kv`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [],
    "operationId": "get_api_plugin_data_kv"
   }
  },
  "/api/plugin-data/overview": {
   "get": {
    "tags": [
     "插件数据存储"
    ],
    "summary": "插件数据存储：查询概览",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugin-data/overview`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [],
    "operationId": "get_api_plugin_data_overview"
   }
  },
  "/api/plugins/cdn_font/groups": {
   "get": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：查询分组",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/cdn_font/groups`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [],
    "operationId": "get_api_plugins_cdn_font_groups"
   },
   "post": {
    "tags": [
     "插件管理"
    ],
    "summary": "插件管理：创建分组",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/cdn_font/groups`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "description": "内部/管理接口的请求体在源码中未结构化或由后台页面定义。外部插件不应依赖；接入内部能力前请查源码或向平台确认。"
       }
      }
     }
    },
    "parameters": [],
    "x-contract-status": "native-cdn-admin-generic",
    "operationId": "post_api_plugins_cdn_font_groups"
   }
  },
  "/api/plugins/cdn_font/groups/{id}": {
   "delete": {
    "tags": [
     "插件"
    ],
    "summary": "分组：按 id 删除",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/cdn_font/groups/{id}`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "路径参数：记录标识"
     }
    ],
    "operationId": "delete_api_plugins_cdn_font_groups_id"
   },
   "put": {
    "tags": [
     "插件管理"
    ],
    "summary": "分组：按 id 更新",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/cdn_font/groups/{id}`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "路径参数：记录标识"
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "description": "内部/管理接口的请求体在源码中未结构化或由后台页面定义。外部插件不应依赖；接入内部能力前请查源码或向平台确认。"
       }
      }
     }
    },
    "x-contract-status": "native-cdn-admin-generic",
    "operationId": "put_api_plugins_cdn_font_groups_id"
   }
  },
  "/api/plugins/cdn_font/items": {
   "get": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：查询条目",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/cdn_font/items`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [],
    "operationId": "get_api_plugins_cdn_font_items"
   },
   "post": {
    "tags": [
     "插件管理"
    ],
    "summary": "插件管理：创建条目",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/cdn_font/items`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "description": "内部/管理接口的请求体在源码中未结构化或由后台页面定义。外部插件不应依赖；接入内部能力前请查源码或向平台确认。"
       }
      }
     }
    },
    "parameters": [],
    "x-contract-status": "native-cdn-admin-generic",
    "operationId": "post_api_plugins_cdn_font_items"
   }
  },
  "/api/plugins/cdn_font/items/{id}": {
   "delete": {
    "tags": [
     "插件"
    ],
    "summary": "条目：按 id 删除",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/cdn_font/items/{id}`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "路径参数：记录标识"
     }
    ],
    "operationId": "delete_api_plugins_cdn_font_items_id"
   },
   "put": {
    "tags": [
     "插件管理"
    ],
    "summary": "条目：按 id 更新",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/cdn_font/items/{id}`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "路径参数：记录标识"
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "description": "内部/管理接口的请求体在源码中未结构化或由后台页面定义。外部插件不应依赖；接入内部能力前请查源码或向平台确认。"
       }
      }
     }
    },
    "x-contract-status": "native-cdn-admin-generic",
    "operationId": "put_api_plugins_cdn_font_items_id"
   }
  },
  "/api/plugins/cdn_image/file/{tenant}/{name}": {
   "get": {
    "tags": [
     "插件"
    ],
    "summary": "tenant：按 name 获取详情",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/cdn_image/file/{tenant}/{name}`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "tenant",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：tenant"
     },
     {
      "name": "name",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：name"
     }
    ],
    "operationId": "get_api_plugins_cdn_image_file_tenant_name"
   }
  },
  "/api/plugins/cdn_image/groups": {
   "get": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：查询分组",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/cdn_image/groups`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [],
    "operationId": "get_api_plugins_cdn_image_groups"
   },
   "post": {
    "tags": [
     "插件管理"
    ],
    "summary": "插件管理：创建分组",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/cdn_image/groups`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "description": "内部/管理接口的请求体在源码中未结构化或由后台页面定义。外部插件不应依赖；接入内部能力前请查源码或向平台确认。"
       }
      }
     }
    },
    "parameters": [],
    "x-contract-status": "native-cdn-admin-generic",
    "operationId": "post_api_plugins_cdn_image_groups"
   }
  },
  "/api/plugins/cdn_image/groups/{id}": {
   "delete": {
    "tags": [
     "插件"
    ],
    "summary": "分组：按 id 删除",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/cdn_image/groups/{id}`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "路径参数：记录标识"
     }
    ],
    "operationId": "delete_api_plugins_cdn_image_groups_id"
   },
   "put": {
    "tags": [
     "插件管理"
    ],
    "summary": "分组：按 id 更新",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/cdn_image/groups/{id}`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "路径参数：记录标识"
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "description": "内部/管理接口的请求体在源码中未结构化或由后台页面定义。外部插件不应依赖；接入内部能力前请查源码或向平台确认。"
       }
      }
     }
    },
    "x-contract-status": "native-cdn-admin-generic",
    "operationId": "put_api_plugins_cdn_image_groups_id"
   }
  },
  "/api/plugins/cdn_image/items": {
   "get": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：查询条目",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/cdn_image/items`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [],
    "operationId": "get_api_plugins_cdn_image_items"
   },
   "post": {
    "tags": [
     "插件管理"
    ],
    "summary": "插件管理：创建条目",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/cdn_image/items`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "description": "内部/管理接口的请求体在源码中未结构化或由后台页面定义。外部插件不应依赖；接入内部能力前请查源码或向平台确认。"
       }
      }
     }
    },
    "parameters": [],
    "x-contract-status": "native-cdn-admin-generic",
    "operationId": "post_api_plugins_cdn_image_items"
   }
  },
  "/api/plugins/cdn_image/items/upload": {
   "post": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：创建上传",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/cdn_image/items/upload`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "description": "内部/管理接口的请求体在源码中未结构化或由后台页面定义。外部插件不应依赖；接入内部能力前请查源码或向平台确认。"
       }
      }
     }
    },
    "parameters": [],
    "x-contract-status": "native-cdn-admin-generic",
    "operationId": "post_api_plugins_cdn_image_items_upload"
   }
  },
  "/api/plugins/cdn_image/items/{id}": {
   "delete": {
    "tags": [
     "插件"
    ],
    "summary": "条目：按 id 删除",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/cdn_image/items/{id}`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "路径参数：记录标识"
     }
    ],
    "operationId": "delete_api_plugins_cdn_image_items_id"
   }
  },
  "/api/plugins/cdn_image/upload": {
   "post": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：创建上传",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/cdn_image/upload`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "description": "内部/管理接口的请求体在源码中未结构化或由后台页面定义。外部插件不应依赖；接入内部能力前请查源码或向平台确认。"
       }
      }
     }
    },
    "parameters": [],
    "x-contract-status": "native-cdn-admin-generic",
    "operationId": "post_api_plugins_cdn_image_upload"
   }
  },
  "/api/plugins/{code}/admin-token": {
   "post": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：创建 admin token（按 code 定位）",
    "description": "管理员代插件申领 scope 令牌。需要 plugin.govern；请求 scope 必须是已授权给该插件的 scope。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PluginTokenReq"
       }
      }
     }
    },
    "operationId": "post_api_plugins_code_admin_token"
   }
  },
  "/api/plugins/{code}/ai/chat": {
   "post": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：创建对话（按 code 定位）",
    "description": "插件调用平台 AI 网关。需要 plugin.manage，受插件状态、平台配额与上游配置限制。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PluginAiChatReq"
       }
      }
     }
    },
    "operationId": "post_api_plugins_code_ai_chat"
   }
  },
  "/api/plugins/{code}/ai/usage": {
   "get": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：查询用量（按 code 定位）",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/{code}/ai/usage`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "operationId": "get_api_plugins_code_ai_usage"
   }
  },
  "/api/plugins/{code}/config": {
   "get": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：查询配置（按 code 定位）",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/{code}/config`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "operationId": "get_api_plugins_code_config"
   },
   "put": {
    "tags": [
     "插件管理"
    ],
    "summary": "插件管理：更新配置（按 code 定位）",
    "description": "整体保存插件配置 JSON。需要 plugin.manage。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": true,
        "description": "配置键值对象，整体写入"
       }
      }
     }
    },
    "operationId": "put_api_plugins_code_config"
   }
  },
  "/api/plugins/{code}/config/schema": {
   "put": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：更新结构（按 code 定位）",
    "description": "整体覆盖插件配置 Schema。需要 plugin.manage。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PluginConfigSchema"
       }
      }
     }
    },
    "operationId": "put_api_plugins_code_config_schema"
   }
  },
  "/api/plugins/{code}/data/{collection}": {
   "get": {
    "tags": [
     "插件"
    ],
    "summary": "data：按 collection 获取详情",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/{code}/data/{collection}`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     },
     {
      "name": "collection",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：collection"
     }
    ],
    "operationId": "get_api_plugins_code_data_collection"
   },
   "post": {
    "tags": [
     "插件管理"
    ],
    "summary": "data：按 collection 操作",
    "description": "创建文档。请求体就是文档 JSON；不是 data 包装。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     },
     {
      "name": "collection",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：collection"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": true,
        "description": "文档对象本身；字段由插件业务与集合 schema 决定"
       },
       "example": {
        "title": "第一条记录",
        "payload": {
         "any": "插件自定义字段"
        }
       }
      }
     }
    },
    "operationId": "post_api_plugins_code_data_collection"
   }
  },
  "/api/plugins/{code}/data/{collection}/schema": {
   "get": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：查询结构（按 code、collection 定位）",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/{code}/data/{collection}/schema`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     },
     {
      "name": "collection",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：collection"
     }
    ],
    "operationId": "get_api_plugins_code_data_collection_schema"
   },
   "put": {
    "tags": [
     "插件管理"
    ],
    "summary": "插件管理：更新结构（按 code、collection 定位）",
    "description": "整体覆盖集合字段校验规则。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     },
     {
      "name": "collection",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：collection"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "fields"
        ],
        "properties": {
         "fields": {
          "type": "array",
          "items": {
           "type": "object"
          }
         }
        }
       }
      }
     }
    },
    "operationId": "put_api_plugins_code_data_collection_schema"
   }
  },
  "/api/plugins/{code}/data/{collection}/{doc_id}": {
   "delete": {
    "tags": [
     "插件"
    ],
    "summary": "collection：按 doc_id 删除",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/{code}/data/{collection}/{doc_id}`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     },
     {
      "name": "collection",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：collection"
     },
     {
      "name": "doc_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：doc_id"
     }
    ],
    "operationId": "delete_api_plugins_code_data_collection_doc_id"
   },
   "get": {
    "tags": [
     "插件管理"
    ],
    "summary": "collection：按 doc_id 获取详情",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/{code}/data/{collection}/{doc_id}`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     },
     {
      "name": "collection",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：collection"
     },
     {
      "name": "doc_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：doc_id"
     }
    ],
    "operationId": "get_api_plugins_code_data_collection_doc_id"
   },
   "put": {
    "tags": [
     "插件管理"
    ],
    "summary": "collection：按 doc_id 更新",
    "description": "更新文档。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     },
     {
      "name": "collection",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：collection"
     },
     {
      "name": "doc_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：doc_id"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": true,
        "description": "完整或部分文档字段，由集合 schema 决定"
       }
      }
     }
    },
    "operationId": "put_api_plugins_code_data_collection_doc_id"
   }
  },
  "/api/plugins/{code}/files": {
   "get": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：查询文件（按 code 定位）",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/{code}/files`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "operationId": "get_api_plugins_code_files"
   }
  },
  "/api/plugins/{code}/files/upload": {
   "post": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：创建上传（按 code 定位）",
    "description": "上传插件文件到调用者数据岛。需要 plugin.manage；query 必须带 ?path=相对路径。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "path",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "插件数据岛内的相对文件路径"
     },
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "type": "object",
        "required": [
         "file"
        ],
        "properties": {
         "file": {
          "type": "string",
          "format": "binary"
         }
        }
       }
      }
     }
    },
    "operationId": "post_api_plugins_code_files_upload"
   }
  },
  "/api/plugins/{code}/grants": {
   "get": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：查询授权（按 code 定位）",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/{code}/grants`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "operationId": "get_api_plugins_code_grants"
   },
   "post": {
    "tags": [
     "插件管理"
    ],
    "summary": "插件管理：创建授权（按 code 定位）",
    "description": "管理员为插件授权 scope。需要 plugin.govern。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "scopes"
        ],
        "properties": {
         "scopes": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "minItems": 1
         },
         "expires_at": {
          "type": "string",
          "description": "YYYY-MM-DD HH:MM:SS 或 ISO；可选"
         }
        }
       }
      }
     }
    },
    "operationId": "post_api_plugins_code_grants"
   }
  },
  "/api/plugins/{code}/grants/{scope}": {
   "delete": {
    "tags": [
     "插件"
    ],
    "summary": "授权：按 scope 删除",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/{code}/grants/{scope}`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     },
     {
      "name": "scope",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：scope"
     }
    ],
    "operationId": "delete_api_plugins_code_grants_scope"
   }
  },
  "/api/plugins/{code}/health": {
   "get": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：查询健康检查（按 code 定位）",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/{code}/health`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "operationId": "get_api_plugins_code_health"
   }
  },
  "/api/plugins/{code}/health/ping": {
   "post": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：创建 ping（按 code 定位）",
    "description": "公开插件心跳上报。插件必须存在；按 IP 限流；status 与 avg_response_ms 会被校验/钳制。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "status": {
          "type": "string",
          "enum": [
           "healthy",
           "unhealthy",
           "degraded",
           "down",
           "unknown"
          ],
          "default": "healthy"
         },
         "avg_response_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 600000,
          "default": 0
         }
        }
       }
      }
     }
    },
    "security": [],
    "operationId": "post_api_plugins_code_health_ping"
   }
  },
  "/api/plugins/{code}/hooks": {
   "get": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：查询钩子（按 code 定位）",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/{code}/hooks`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "operationId": "get_api_plugins_code_hooks"
   },
   "post": {
    "tags": [
     "插件管理"
    ],
    "summary": "插件管理：创建钩子（按 code 定位）",
    "description": "为插件注册事件回调。需要 plugin.manage。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/HookRegisterReq"
       }
      }
     }
    },
    "operationId": "post_api_plugins_code_hooks"
   }
  },
  "/api/plugins/{code}/hooks/{id}": {
   "delete": {
    "tags": [
     "插件"
    ],
    "summary": "钩子：按 id 删除",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/{code}/hooks/{id}`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     },
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "路径参数：记录标识"
     }
    ],
    "operationId": "delete_api_plugins_code_hooks_id"
   }
  },
  "/api/plugins/{code}/jobs": {
   "get": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：查询任务（按 code 定位）",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/{code}/jobs`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "operationId": "get_api_plugins_code_jobs"
   },
   "post": {
    "tags": [
     "插件管理"
    ],
    "summary": "插件管理：创建任务（按 code 定位）",
    "description": "向异步任务队列投递任务。需要 plugin.manage；插件身份由路径 code 决定。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/JobEnqueueReq"
       }
      }
     }
    },
    "operationId": "post_api_plugins_code_jobs"
   }
  },
  "/api/plugins/{code}/kv/{key}": {
   "delete": {
    "tags": [
     "插件"
    ],
    "summary": "键值：按 key 删除",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/{code}/kv/{key}`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     },
     {
      "name": "key",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：key"
     }
    ],
    "operationId": "delete_api_plugins_code_kv_key"
   },
   "get": {
    "tags": [
     "插件管理"
    ],
    "summary": "键值：按 key 获取详情",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/{code}/kv/{key}`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     },
     {
      "name": "key",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：key"
     }
    ],
    "operationId": "get_api_plugins_code_kv_key"
   },
   "put": {
    "tags": [
     "插件管理"
    ],
    "summary": "键值：按 key 更新",
    "description": "写入带 TTL 的键值，值可为任意 JSON；按调用者数据岛隔离。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     },
     {
      "name": "key",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PluginKvPutReq"
       }
      }
     }
    },
    "operationId": "put_api_plugins_code_kv_key"
   }
  },
  "/api/plugins/{code}/payments": {
   "get": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：查询 payments（按 code 定位）",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/{code}/payments`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "operationId": "get_api_plugins_code_payments"
   },
   "post": {
    "tags": [
     "插件管理"
    ],
    "summary": "插件管理：创建 payments（按 code 定位）",
    "description": "插件内扣费。金额单位为微单位且必须大于 0；user_id 指向该插件自己的用户。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PluginPaymentReq"
       }
      }
     }
    },
    "operationId": "post_api_plugins_code_payments"
   }
  },
  "/api/plugins/{code}/push": {
   "post": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：执行推送（按 code 定位）",
    "description": "向插件房间推送实时消息。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PluginPushReq"
       }
      }
     }
    },
    "operationId": "post_api_plugins_code_push"
   }
  },
  "/api/plugins/{code}/rooms": {
   "get": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：查询 rooms（按 code 定位）",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/{code}/rooms`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "operationId": "get_api_plugins_code_rooms"
   },
   "post": {
    "tags": [
     "插件管理"
    ],
    "summary": "插件管理：创建 rooms（按 code 定位）",
    "description": "创建或更新插件房间。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PluginRoomReq"
       }
      }
     }
    },
    "operationId": "post_api_plugins_code_rooms"
   }
  },
  "/api/plugins/{code}/rpc": {
   "post": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：创建 rpc（按 code 定位）",
    "description": "跨插件 RPC 调用。需要 plugin.manage，且 caller→target/method 必须有 plugin_rpc_grants 显式授权。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/RpcCallReq"
       }
      }
     }
    },
    "operationId": "post_api_plugins_code_rpc"
   }
  },
  "/api/plugins/{code}/sandbox/exec": {
   "post": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：执行执行（按 code 定位）",
    "description": "执行已配置且 active 的插件沙箱。需要 plugin.manage；默认 timeout 5000ms、memory 256MB、cpu 1000ms、network deny、filesystem readonly。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "payload": {
          "description": "传给沙箱入口的任意 JSON"
         }
        }
       }
      }
     }
    },
    "operationId": "post_api_plugins_code_sandbox_exec"
   }
  },
  "/api/plugins/{code}/scheduler": {
   "get": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：查询 scheduler（按 code 定位）",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/{code}/scheduler`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "operationId": "get_api_plugins_code_scheduler"
   },
   "post": {
    "tags": [
     "插件管理"
    ],
    "summary": "插件管理：创建 scheduler（按 code 定位）",
    "description": "创建定时任务。需要 plugin.manage。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SchedulerCreateReq"
       }
      }
     }
    },
    "operationId": "post_api_plugins_code_scheduler"
   }
  },
  "/api/plugins/{code}/scheduler/{id}": {
   "delete": {
    "tags": [
     "插件"
    ],
    "summary": "scheduler：按 id 删除",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/{code}/scheduler/{id}`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     },
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "路径参数：记录标识"
     }
    ],
    "operationId": "delete_api_plugins_code_scheduler_id"
   },
   "put": {
    "tags": [
     "插件管理"
    ],
    "summary": "scheduler：按 id 更新",
    "description": "更新定时任务。需要 plugin.manage 与归属校验。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     },
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "路径参数：记录标识"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SchedulerUpdateReq"
       }
      }
     }
    },
    "operationId": "put_api_plugins_code_scheduler_id"
   }
  },
  "/api/plugins/{code}/schemas": {
   "get": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：查询 schemas（按 code 定位）",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/{code}/schemas`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "operationId": "get_api_plugins_code_schemas"
   }
  },
  "/api/plugins/{code}/storage/objects": {
   "get": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：查询对象（按 code 定位）",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/{code}/storage/objects`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "operationId": "get_api_plugins_code_storage_objects"
   }
  },
  "/api/plugins/{code}/store": {
   "get": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：查询 store（按 code 定位）",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/{code}/store`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "operationId": "get_api_plugins_code_store"
   }
  },
  "/api/plugins/{code}/token": {
   "post": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：创建令牌（按 code 定位）",
    "description": "插件用插件专属验签密钥申领限时 scope 令牌。必须带 X-Platform-Signature（HMAC-SHA256(插件密钥, code+timestamp)）、X-Platform-Timestamp、X-Platform-Plugin、X-Platform-Signature-Version: v1；scope 必须已由 plugin.govern 管理员授权且未过期。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PluginTokenReq"
       }
      }
     }
    },
    "operationId": "post_api_plugins_code_token"
   }
  },
  "/api/plugins/{code}/token/verify": {
   "post": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：执行校验（按 code 定位）",
    "description": "校验插件作用域令牌，需要 plugin.view。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PluginTokenVerifyReq"
       }
      }
     }
    },
    "operationId": "post_api_plugins_code_token_verify"
   }
  },
  "/api/plugins/{code}/ui-slots": {
   "get": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：查询界面插槽（按 code 定位）",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/{code}/ui-slots`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "operationId": "get_api_plugins_code_ui_slots"
   },
   "post": {
    "tags": [
     "插件管理"
    ],
    "summary": "插件管理：创建界面插槽（按 code 定位）",
    "description": "创建/更新插件自己的 UI 插槽。plugin_code 由路径覆盖。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/UiSlotReq"
       }
      }
     }
    },
    "operationId": "post_api_plugins_code_ui_slots"
   }
  },
  "/api/plugins/{code}/ui-slots/{id}": {
   "delete": {
    "tags": [
     "插件"
    ],
    "summary": "界面插槽：按 id 删除",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/{code}/ui-slots/{id}`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     },
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "路径参数：记录标识"
     }
    ],
    "operationId": "delete_api_plugins_code_ui_slots_id"
   }
  },
  "/api/plugins/{code}/users": {
   "get": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：查询用户（按 code 定位）",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/{code}/users`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "operationId": "get_api_plugins_code_users"
   }
  },
  "/api/plugins/{code}/users/login": {
   "post": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：创建登录（按 code 定位）",
    "description": "插件自有用户登录，公开端点；按 IP 限流。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PluginUserLoginReq"
       }
      }
     }
    },
    "operationId": "post_api_plugins_code_users_login"
   }
  },
  "/api/plugins/{code}/users/register": {
   "post": {
    "tags": [
     "插件"
    ],
    "summary": "插件管理：创建 register（按 code 定位）",
    "description": "插件自有用户注册，公开端点；插件必须存在且启用，按 IP 限流。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PluginUserRegisterReq"
       }
      }
     }
    },
    "operationId": "post_api_plugins_code_users_register"
   }
  },
  "/api/public/plugins/{code}/ai-report": {
   "post": {
    "tags": [
     "公开接口"
    ],
    "summary": "公开接口：创建 ai report（按 code 定位）",
    "description": "匿名提交插件 AI 报告，业务字段平铺；高频时提示验证码。数据落入 public 数据岛。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PublicAiReportReq"
       }
      }
     }
    },
    "security": [],
    "operationId": "post_api_public_plugins_code_ai_report"
   }
  },
  "/api/public/plugins/{code}/data/{collection}": {
   "post": {
    "tags": [
     "公开接口"
    ],
    "summary": "data：按 collection 操作",
    "description": "匿名向插件公共收件箱写入文档。业务字段平铺 + 一次性验证码；高频提交需要验证码，数据落入 public 数据岛。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     },
     {
      "name": "collection",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：collection"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PublicPluginDocReq"
       }
      }
     }
    },
    "security": [],
    "operationId": "post_api_public_plugins_code_data_collection"
   }
  },
  "/api/protocols": {
   "get": {
    "summary": "协议清单",
    "description": "返回本平台支持的全部 API 协议入口、端点与状态。AI 可据此发现能力。",
    "tags": [
     "协议网关"
    ],
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "parameters": [],
    "operationId": "get_api_protocols"
   }
  },
  "/api/protocols/cfapi.proto": {
   "get": {
    "summary": "下载 .proto IDL",
    "description": "返回 protobuf IDL 原文，供 connect-go / connect-es / connect-py 生成客户端代码。",
    "tags": [
     "协议网关"
    ],
    "responses": {
     "200": {
      "description": "text/plain，cfapi.proto 全文"
     }
    },
    "parameters": [],
    "operationId": "get_api_protocols_cfapi_proto"
   }
  },
  "/api/plugins/{code}/files/download/{path}": {
   "get": {
    "tags": [
     "插件"
    ],
    "summary": "下载：按 path:.* 获取详情",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/{code}/files/download/{path:.*}`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     },
     {
      "name": "path",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数 path"
     }
    ],
    "operationId": "get_api_plugins_code_files_download_path"
   }
  },
  "/api/plugins/{code}/files/{path}": {
   "delete": {
    "tags": [
     "插件"
    ],
    "summary": "文件：按 path:.* 删除",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/{code}/files/{path:.*}`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     },
     {
      "name": "path",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数 path"
     }
    ],
    "operationId": "delete_api_plugins_code_files_path"
   }
  },
  "/api/plugins/{code}/storage/objects/{key}": {
   "delete": {
    "tags": [
     "插件"
    ],
    "summary": "对象：按 key:.* 删除",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/{code}/storage/objects/{key:.*}`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     },
     {
      "name": "key",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数 key"
     }
    ],
    "operationId": "delete_api_plugins_code_storage_objects_key"
   },
   "get": {
    "tags": [
     "插件管理"
    ],
    "summary": "对象：按 key:.* 获取详情",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/{code}/storage/objects/{key:.*}`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     },
     {
      "name": "key",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数 key"
     }
    ],
    "operationId": "get_api_plugins_code_storage_objects_key"
   },
   "put": {
    "tags": [
     "插件管理"
    ],
    "summary": "对象：按 key:.* 更新",
    "description": "以原始字节写入插件私有对象存储。需要 plugin.manage；key 支持多级路径；受单对象与总容量策略限制。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     },
     {
      "name": "key",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数 key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/octet-stream": {
       "schema": {
        "type": "string",
        "format": "binary"
       }
      }
     }
    },
    "operationId": "put_api_plugins_code_storage_objects_key"
   }
  },
  "/api/plugins/{code}/store/{key}": {
   "delete": {
    "tags": [
     "插件"
    ],
    "summary": "store：按 key:.* 删除",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/{code}/store/{key:.*}`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     },
     {
      "name": "key",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数 key"
     }
    ],
    "operationId": "delete_api_plugins_code_store_key"
   },
   "get": {
    "tags": [
     "插件管理"
    ],
    "summary": "store：按 key:.* 获取详情",
    "description": "由源码路由表自动生成。真实挂载路径：`/api/plugins/{code}/store/{key:.*}`（同时可用 `/api/v1` 前缀）。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     },
     {
      "name": "key",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数 key"
     }
    ],
    "operationId": "get_api_plugins_code_store_key"
   },
   "put": {
    "tags": [
     "插件管理"
    ],
    "summary": "store：按 key:.* 更新",
    "description": "写入数据岛内的键值。value 为字符串；namespace 缺省 default。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：code"
     },
     {
      "name": "key",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数 key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DataStorePutReq"
       }
      }
     }
    },
    "operationId": "put_api_plugins_code_store_key"
   }
  },
  "/api/plugins/{from}/call/{to}/{path}": {
   "post": {
    "tags": [
     "插件"
    ],
    "summary": "to：按 path:.* 操作",
    "description": "显式授权的跨插件调用。需要 plugin.manage；from→to/method 必须存在于 plugin_rpc_grants；目标必须是启用的 remote 插件。",
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "未认证或令牌无效"
     },
     "403": {
      "description": "权限不足，或接口层级不允许（外部层级访问内部专属能力）"
     }
    },
    "parameters": [
     {
      "name": "from",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：from"
     },
     {
      "name": "to",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数：to"
     },
     {
      "name": "path",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "路径参数 path"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/InterPluginCallReq"
       }
      }
     }
    },
    "operationId": "post_api_plugins_from_call_to_path"
   }
  },
  "/api/market/upload": {
   "post": {
    "tags": [
     "插件市场"
    ],
    "summary": "市场投稿：上传插件 ZIP（multipart/form-data，字段名 file）",
    "description": "任意有效登录用户可调用，不需要 plugin.manage。plugin_code 只能小写字母/数字/下划线；ZIP 上限 500 MB；已归属他人或平台的插件只有超管可覆盖。成功返回 download_url，但尚未提交审核。",
    "security": [
     {
      "bearer": []
     }
    ],
    "parameters": [
     {
      "name": "plugin_code",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9_]{1,64}$"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "type": "object",
        "required": [
         "file"
        ],
        "properties": {
         "file": {
          "type": "string",
          "format": "binary"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "上传成功，返回 download_url",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "code": {
           "type": "integer"
          },
          "message": {
           "type": "string"
          },
          "data": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "参数错误"
     },
     "401": {
      "description": "未认证"
     },
     "403": {
      "description": "无权限"
     }
    },
    "x-required-permission": "authenticated",
    "operationId": "post_api_market_upload"
   }
  },
  "/api/plugins/templates": {
   "get": {
    "tags": [
     "插件"
    ],
    "summary": "已公布的可下载模板插件列表（公开）",
    "description": "返回 status=1、approval_status=approved、is_template=1 的插件模板；不是所有市场插件。",
    "security": [],
    "responses": {
     "200": {
      "description": "模板列表",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "code": {
           "type": "integer"
          },
          "message": {
           "type": "string"
          },
          "data": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "参数错误"
     },
     "401": {
      "description": "未认证"
     },
     "403": {
      "description": "无权限"
     }
    },
    "operationId": "get_api_plugins_templates"
   }
  },
  "/api/plugins/callable": {
   "get": {
    "tags": [
     "插件"
    ],
    "summary": "可调用插件目录（需登录）",
    "description": "返回 approved 且已启用的插件元数据。注意：目录可见不等于可调用；proxy 仅支持 remote + base_url，且读/写分别需要 plugin.view/plugin.manage。",
    "security": [
     {
      "bearer": []
     }
    ],
    "responses": {
     "200": {
      "description": "目录列表",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "code": {
           "type": "integer"
          },
          "message": {
           "type": "string"
          },
          "data": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "参数错误"
     },
     "401": {
      "description": "未认证"
     },
     "403": {
      "description": "无权限"
     }
    },
    "operationId": "get_api_plugins_callable"
   }
  },
  "/api/plugins/{code}/export-template": {
   "get": {
    "tags": [
     "插件"
    ],
    "summary": "下载已公布模板插件源码 ZIP（公开）",
    "description": "仅 is_template=1、status=1、approval_status=approved 的插件可导出；其他情况 404。",
    "security": [],
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9_]{1,64}$"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "ZIP 二进制",
      "content": {
       "application/zip": {
        "schema": {
         "type": "string",
         "format": "binary"
        }
       }
      }
     },
     "404": {
      "description": "不是已公布模板或不存在"
     }
    },
    "operationId": "get_api_plugins_code_export_template"
   }
  },
  "/api/plugins/{code}/signing-secret": {
   "get": {
    "tags": [
     "插件"
    ],
    "summary": "取得本插件的代理验签密钥（需 plugin.manage + 归属）",
    "description": "返回按 plugin_code 派生的 HMAC-SHA256 密钥，用于校验 X-Platform-Signature / X-Platform-Caller-Signature。不返回平台全局密钥。仅归属人或超管可读；响应 no-store。",
    "security": [
     {
      "bearer": []
     }
    ],
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9_]{1,64}$"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "code": {
           "type": "integer"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "plugin_code": {
             "type": "string"
            },
            "secret_algorithm": {
             "type": "string",
             "example": "HMAC-SHA256"
            },
            "plugin_secret": {
             "type": "string",
             "description": "按插件派生的验签密钥；不得写入前端或公开仓库"
            },
            "signature_headers": {
             "type": "object"
            },
            "rotation_note": {
             "type": "string"
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "缺少 plugin.manage 或非插件归属人"
     },
     "404": {
      "description": "插件不存在"
     }
    },
    "x-required-permission": "plugin.manage",
    "operationId": "get_api_plugins_code_signing_secret"
   }
  },
  "/api/market/submissions/{code}/signing-secret": {
   "get": {
    "tags": [
     "插件市场"
    ],
    "summary": "市场开发者取得自己已批准插件的验签密钥",
    "description": "仅原始提交者本人或超管可读，且提交状态必须为 approved。返回按 plugin_code 派生的密钥，不是平台全局密钥。用于 remote 插件验证 X-Platform-Signature。",
    "security": [
     {
      "bearer": []
     }
    ],
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9_]{1,64}$"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "code": {
           "type": "integer"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "plugin_code": {
             "type": "string"
            },
            "secret_algorithm": {
             "type": "string",
             "example": "HMAC-SHA256"
            },
            "plugin_secret": {
             "type": "string",
             "description": "按插件派生的验签密钥；不得写入前端或公开仓库"
            },
            "signature_headers": {
             "type": "object"
            },
            "rotation_note": {
             "type": "string"
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "非提交者、非超管，或状态不是 approved"
     },
     "404": {
      "description": "没有市场提交记录"
     }
    },
    "x-required-permission": "authenticated-owner",
    "operationId": "get_api_market_submissions_code_signing_secret"
   }
  },
  "/api/market/submissions/{code}/withdraw": {
   "post": {
    "summary": "撤回待审的市场提交",
    "description": "仅提交者本人或超管可撤回，且仅当状态为 pending。撤回是删除动作：该提交记录会被移除，市场不会保留草稿；需要重新提交请走 POST /api/market/submit。已 approved / rejected 的提交不能撤回。",
    "tags": [
     "插件市场"
    ],
    "security": [
     {
      "bearer": []
     }
    ],
    "responses": {
     "200": {
      "description": "撤回成功",
      "content": {
       "application/json": {
        "example": {
         "code": 0,
         "message": "已撤回该插件的待审提交",
         "data": null
        }
       }
      }
     },
     "400": {
      "description": "当前状态不是 pending（40000）"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "description": "该插件没有提交记录（40400）"
     }
    },
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9_]{1,64}$"
      }
     }
    ],
    "operationId": "post_api_market_submissions_code_withdraw"
   }
  },
  "/api/plugins/mine": {
   "get": {
    "summary": "列出我名下的插件与最近提交状态",
    "description": "返回当前登录账号作为归属人的插件，以及每个插件的最近一次市场提交状态（pending / approved / rejected）与审核备注。只读，不受 plugin.view 限制，任何登录账号都只能看到自己的。",
    "tags": [
     "插件"
    ],
    "security": [
     {
      "bearer": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "example": {
         "code": 0,
         "message": "ok",
         "data": {
          "items": [
           {
            "code": "demo",
            "name": "示例",
            "ptype": "local",
            "status": 1,
            "approval_status": "approved",
            "submission": {
             "status": "approved",
             "review_notes": null
            }
           }
          ],
          "total": 1
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "429": {
      "$ref": "#/components/responses/TooManyRequests"
     }
    },
    "operationId": "get_api_plugins_mine"
   }
  },
  "/api/plugins/categories": {
   "get": {
    "summary": "列出插件分类",
    "description": "按层级（external / internal）读取分类，用于市场投稿时选择 category。需要 plugin.view。",
    "tags": [
     "插件"
    ],
    "security": [
     {
      "bearer": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "example": {
         "code": 0,
         "message": "ok",
         "data": null
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "429": {
      "$ref": "#/components/responses/TooManyRequests"
     }
    },
    "x-required-permission": "plugin.view",
    "parameters": [
     {
      "name": "tier",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "external",
        "internal"
       ]
      }
     }
    ],
    "operationId": "get_api_plugins_categories"
   },
   "post": {
    "summary": "新建插件分类",
    "description": "需要 plugin.manage。body 至少包含 tier 与 name（≤128 字符），可选 sort_order。分类是平台级配置，普通开发者无此权限。",
    "tags": [
     "插件"
    ],
    "security": [
     {
      "bearer": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "example": {
         "code": 0,
         "message": "ok",
         "data": null
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "429": {
      "$ref": "#/components/responses/TooManyRequests"
     }
    },
    "x-required-permission": "plugin.manage",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "tier",
         "name"
        ],
        "properties": {
         "tier": {
          "type": "string",
          "enum": [
           "external",
           "internal"
          ]
         },
         "name": {
          "type": "string",
          "maxLength": 128
         },
         "sort_order": {
          "type": "integer"
         }
        }
       }
      }
     }
    },
    "operationId": "post_api_plugins_categories"
   }
  },
  "/api/plugins/{code}/submit-review": {
   "post": {
    "summary": "把自有插件提交审核（旧版私有链路）",
    "description": "需要 plugin.manage 且为插件归属人。仅用于内部私有插件的审核状态流转；外部开发者发布请走市场链路（POST /api/market/upload → POST /api/market/submit），不要使用本接口。已 approved 的插件再次提交会返回 400。",
    "tags": [
     "插件"
    ],
    "security": [
     {
      "bearer": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功",
      "content": {
       "application/json": {
        "example": {
         "code": 0,
         "message": "ok",
         "data": null
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "429": {
      "$ref": "#/components/responses/TooManyRequests"
     }
    },
    "x-required-permission": "plugin.manage",
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "operationId": "post_api_plugins_code_submit_review"
   }
  }
 },
 "x-scope": "public+plugin",
 "x-source": "/api/openapi.json"
}