diff --git a/backend/python/app/api/market.py b/backend/python/app/api/market.py index ee71b4e..5d0bc62 100644 --- a/backend/python/app/api/market.py +++ b/backend/python/app/api/market.py @@ -340,13 +340,22 @@ def upload_app( detail=f"Agent 连接校验未通过:{v['detail']}", ) + # source 判定:管理员(admin 角色)通过前台市场导入/开发的 Agent/Skill/MCP + # 统一标记为官方(official),其余用户按请求或默认为 user。 + if current_user.role == "admin": + app_source = "official" + elif req.source and req.source in ("official", "user"): + app_source = req.source + else: + app_source = "user" + app = MarketApp( id=gen_uuid(), name=req.name, description=req.description, icon=req.icon, type=req.type if req.type in ("skill","agent","mcp") else "skill", - source=req.source if req.source in ("official","user") else "user", + source=app_source, platform=req.platform, price=req.price, install_count=0,