Repository navigation
Conversation
added 3 commits
June 26, 2026 11:00
- Add closed_source frontmatter flag parsed via pkg/util/skill.go (IsSkillClosedSource / InjectClosedSourceFlag), backward compatible - Publish config page: add closed-source switch (appPublishActions / createScope) - UpdateAppVersion supports toggling closed-source on republish via new markdown field in UpdatePublishCustomSkillReq (proto + pb.go + orm + grpc) - Square/acquired skill list & detail return isClosedSource; closed-source skills hide body (stripSkillBody) and block ZIP download for non-author users - Frontend: show closed-source badge for both authors and users, hide download button for closed-source skills - docker-compose-develop.yaml: switch to WANWU_FRONTEND/BACKEND_IMAGE env vars
docker-compose-develop.yaml changes were local testing only (image env vars / port), not part of the closed-source feature
…tePublishCustomSkillReq descriptor The rawDesc protobuf descriptor was missing the markdown field for UpdatePublishCustomSkillReq, causing gRPC to silently drop the markdown payload when BFF called mcp-service to toggle closed-source flag. Regenerated with protoc-gen-go v1.34.1 to keep diff minimal.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
一、需求来源
基于公益服务渠道收集大量社区创作者反馈:
大量志愿者、行业从业者愿意无偿贡献自身专业技能搭建平台 Skill,但担忧自己沉淀的业务经验、行业私有数据上传后完全无限制对外公开,存在隐私与数据泄露顾虑,因此提出需要自主管控 Skill 开放权限的功能需求。
二、本次实现功能
发布流程新增开关
在 Skill 新建发布页面,增加「开源 / 闭源」切换选项,创作者发布时即可提前设定技能开放状态;
后台管理状态操作
在 Skill 「发布管理」页,同步增加状态切换操作按钮,已发布技能支持随时修改开源 / 闭源属性;
权限逻辑约束
闭源状态下,该 Skill 对应的个人经验、私有业务数据仅创作者本人可见,其他用户无法读取完整内部内容;开源状态保持原有全公开逻辑不变,兼容旧版使用习惯。
三、实现方式
后端改动逐层分析
1. Proto 层
UpdatePublishCustomSkillReq新增markdown字段 (field 3)2. mcp-service 层
(skillId, versionDesc)→(skillId, versionDesc, markdown)Update("version_description", ...)→Updates(map),markdown 非空才更新req.Markdown3. bff-service 层
UpdateAppVersion新增isClosedSource *bool参数isClosedSource=nil时传空 markdown,mcp 不更新 markdown 列,与原逻辑完全一致GetAppLatestVersionskill 分支新增IsClosedSource读取PublishAppskill 分支注入闭源标记IsClosedSource字段4. 广场/资源库闭源逻辑
关键设计:所有闭源限制都以
util.IsSkillClosedSource()返回 true 为前提,开源 skill 完全不走闭源分支。IsSkillClosedSource返回 false → 跳过,返回完整正文IsSkillClosedSource返回 false → 跳过,正常下载5. 工具函数
6. Request/Response Model
新增
IsClosedSource字段:*bool(指针):nil 表示不修改,JSON 反序列化老请求(无该字段)为 nilbool:老前端不读取该字段,无影响前端改动分析
v-if="appType === 'skill'"v-if="!isClosedSource"控制下载按钮三、潜在风险点
toAcquiredSkillInfo中skill.GetSkill().GetMarkdown()skill.GetSkill().GetSkill(),新增调用使用同一对象,nil 风险与原代码一致,未引入新风险InjectClosedSourceFlag(markdown, false)会移除已有的closed_source:行GetPublishCustomSkillByIDList批量查询对原有代码和功能无破坏性影响。