Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

♻️ refactor: remove client-side community publish/unpublish entry points (#15986)

AmAzing-ba2660c8c986
diff --git a/locales/en-US/marketAuth.json b/locales/en-US/marketAuth.json
index 0450e11c650..823fa59b139 100644
--- a/locales/en-US/marketAuth.json
+++ b/locales/en-US/marketAuth.json
@@ -7,11 +7,9 @@
"authorize.footer.terms": "Terms of Service",
"authorize.scenes.mcp.subtitle": "Create a community profile to install and run this skill from the community.",
"authorize.scenes.mcp.title": "Install Community Skill",
- "authorize.scenes.publish.subtitle": "Create a community profile to publish and manage your listing within the community.",
- "authorize.scenes.publish.title": "Publish to the Community",
"authorize.scenes.sandbox.subtitle": "Create a community profile to run this tool in the community sandbox.",
"authorize.scenes.sandbox.title": "Try the Community Sandbox",
- "authorize.subtitle": "Create a community profile to submit and manage listings within the community.",
+ "authorize.subtitle": "Create a community profile to use community features.",
"authorize.title": "Create Community Profile",
"callback.buttons.close": "Close Window",
"callback.messages.authFailed": "Authorization failed: {{error}}",
@@ -50,8 +48,6 @@
"messages.handoffTimeout": "Authorization timed out. Finish it in your browser, then retry.",
"messages.loading": "Starting authorization process...",
"messages.success.cloudMcpInstall": "Authorization successful! You can now install the Cloud MCP skill.",
- "messages.success.submit": "Authorization successful! You can now publish your agent.",
- "messages.success.upload": "Authorization successful! You can now publish a new version.",
"profileSetup.cancel": "Cancel",
"profileSetup.confirmChangeUserId.cancel": "Cancel",
"profileSetup.confirmChangeUserId.confirm": "Change User ID",
diff --git a/locales/en-US/setting.json b/locales/en-US/setting.json
index d0acf495ecb..1a1c508c673 100644
--- a/locales/en-US/setting.json
+++ b/locales/en-US/setting.json
@@ -440,60 +440,7 @@
"llm.proxyUrl.title": "API proxy URL",
"llm.waitingForMore": "More models are <1>planned to be added</1>, stay tuned",
"llm.waitingForMoreLinkAriaLabel": "Open the Provider request form",
- "marketPublish.forkConfirm.by": "by {{author}}",
- "marketPublish.forkConfirm.confirm": "Confirm Publish",
- "marketPublish.forkConfirm.confirmGroup": "Confirm Publish",
- "marketPublish.forkConfirm.description": "You are about to publish a derivative version based on an existing agent from the community. Your new agent will be created as a separate entry in the marketplace.",
- "marketPublish.forkConfirm.descriptionGroup": "You are about to publish a derivative version based on an existing group from the community. Your new group will be created as a separate entry in the marketplace.",
- "marketPublish.forkConfirm.title": "Publish Derivative Agent",
- "marketPublish.forkConfirm.titleGroup": "Publish Derivative Group",
- "marketPublish.modal.changelog.extra": "Describe the key changes and improvements in this version",
- "marketPublish.modal.changelog.label": "Changelog",
- "marketPublish.modal.changelog.maxLengthError": "Changelog must not exceed 500 characters",
- "marketPublish.modal.changelog.placeholder": "Enter the changelog",
- "marketPublish.modal.changelog.required": "Please enter the changelog",
- "marketPublish.modal.comparison.local": "Current Local Version",
- "marketPublish.modal.comparison.remote": "Currently Published Version",
- "marketPublish.modal.identifier.extra": "This is the Agent’s unique identifier. Use lowercase letters, numbers, and hyphens.",
- "marketPublish.modal.identifier.label": "Agent Identifier",
- "marketPublish.modal.identifier.lengthError": "Identifier must be between 3 and 50 characters",
- "marketPublish.modal.identifier.patternError": "Identifier can only contain lowercase letters, numbers, and hyphens",
- "marketPublish.modal.identifier.placeholder": "Enter a unique identifier for the agent, e.g., web-development",
- "marketPublish.modal.identifier.required": "Please enter the agent identifier",
- "marketPublish.modal.loading.fetchingRemote": "Loading remote data...",
- "marketPublish.modal.loading.submit": "Submitting Agent...",
- "marketPublish.modal.loading.submitGroup": "Submitting Group...",
- "marketPublish.modal.loading.upload": "Publishing new version...",
- "marketPublish.modal.loading.uploadGroup": "Publishing new group version...",
- "marketPublish.modal.messages.createVersionFailed": "Failed to create version: {{message}}",
- "marketPublish.modal.messages.fetchRemoteFailed": "Failed to fetch remote agent data",
- "marketPublish.modal.messages.missingIdentifier": "This Agent doesn’t have a Community identifier yet.",
- "marketPublish.modal.messages.noGroup": "No group selected",
- "marketPublish.modal.messages.notAuthenticated": "Sign in to your Community account first.",
- "marketPublish.modal.messages.publishFailed": "Publish failed: {{message}}",
- "marketPublish.modal.submitButton": "Publish",
- "marketPublish.modal.title.submit": "Share to Agent Community",
- "marketPublish.modal.title.upload": "Publish New Version",
- "marketPublish.resultModal.message": "Your Agent has been submitted for review. Once approved, it will go live automatically.",
- "marketPublish.resultModal.messageGroup": "Your Group has been submitted for review. Once approved, it will go live automatically.",
- "marketPublish.resultModal.title": "Submission Successful",
- "marketPublish.resultModal.view": "View in Community",
"marketPublish.status.underReview": "Under Review",
- "marketPublish.submit.button": "Share to Community",
- "marketPublish.submit.tooltip": "Share this Agent to the Community",
- "marketPublish.submitGroup.tooltip": "Share this Group to the Community",
- "marketPublish.upload.button": "Publish New Version",
- "marketPublish.upload.tooltip": "Publish a new version to Agent Community",
- "marketPublish.uploadGroup.tooltip": "Publish a new version to Group Community",
- "marketPublish.validation.communitySetupRequired.action": "Set Up Now",
- "marketPublish.validation.communitySetupRequired.desc": "This workspace hasn't set up its Community profile yet. Set it up before publishing to the Community.",
- "marketPublish.validation.communitySetupRequired.memberHint": "This workspace hasn't set up its Community profile yet. Ask a workspace owner to set it up before publishing to the Community.",
- "marketPublish.validation.communitySetupRequired.title": "Set Up Community Profile First",
- "marketPublish.validation.confirmPublish": "Publish to the Market?",
- "marketPublish.validation.confirmPublishDesc": "Once published, this content will be publicly visible in the market and available for anyone to discover and use.",
- "marketPublish.validation.emptyName": "Cannot publish: Name is required",
- "marketPublish.validation.emptySystemRole": "Cannot publish: System Role is required",
- "marketPublish.validation.underReview": "Your new version is currently under review. Please wait for approval before publishing a new version.",
"memory.effort.desc": "Control how aggressively the AI retrieves and updates memory.",
"memory.effort.high": "High — Proactive retrieval and updates",
"memory.effort.level.high": "High",
@@ -515,14 +462,6 @@
"myAgents.actions.deprecateLoading": "Deprecating agent...",
"myAgents.actions.deprecateSuccess": "Agent deprecated",
"myAgents.actions.edit": "Edit Agent",
- "myAgents.actions.publish": "Publish Agent",
- "myAgents.actions.publishError": "Failed to publish agent",
- "myAgents.actions.publishLoading": "Publishing agent...",
- "myAgents.actions.publishSuccess": "Agent published",
- "myAgents.actions.unpublish": "Unpublish Agent",
- "myAgents.actions.unpublishError": "Failed to unpublish agent",
- "myAgents.actions.unpublishLoading": "Unpublishing agent...",
- "myAgents.actions.unpublishSuccess": "Agent unpublished",
"myAgents.actions.viewDetail": "View Details",
"myAgents.detail.category": "Category",
"myAgents.detail.description": "Description",
@@ -587,7 +526,6 @@
"plugin.settings.title": "{{id}} Skill Configuration",
"plugin.settings.tooltip": "Skill Configuration",
"plugin.store": "Skill Store",
- "publishToCommunity": "Publish to Community",
"serviceModel.contextLimit.placeholder": "Context limit",
"serviceModel.memoryModels.title": "Memory Models",
"serviceModel.modelAssignments.title": "Model Assignments",
@@ -955,13 +893,6 @@
"storageOverage.usage.estimatedCharge": "Est. Cycle Charge",
"storageOverage.usage.incurredCharge": "Incurred This Cycle",
"storageOverage.usage.overage": "Overage",
- "submitAgentModal.button": "Submit Agent",
- "submitAgentModal.identifier": "Agent Identifier",
- "submitAgentModal.metaMiss": "Please complete the agent information before submitting. It should include name, description, and tags",
- "submitAgentModal.placeholder": "Enter a unique identifier for the agent, e.g. web-development",
- "submitAgentModal.success": "Agent submitted successfully",
- "submitAgentModal.tooltips": "Share to Agent Community",
- "submitGroupModal.tooltips": "Share to Group Community",
"sync.device.deviceName.hint": "Add a name for easy identification",
"sync.device.deviceName.placeholder": "Enter device name",
"sync.device.deviceName.title": "Device Name",
diff --git a/locales/zh-CN/marketAuth.json b/locales/zh-CN/marketAuth.json
index 54803041c32..e0fb9e78051 100644
--- a/locales/zh-CN/marketAuth.json
+++ b/locales/zh-CN/marketAuth.json
@@ -7,11 +7,9 @@
"authorize.footer.terms": "服务条款",
"authorize.scenes.mcp.subtitle": "创建社区个人档案,即可安装并运行该社区技能。",
"authorize.scenes.mcp.title": "安装社区技能",
- "authorize.scenes.publish.subtitle": "创建社区个人档案,以便在社区发布和管理你的上架内容。",
- "authorize.scenes.publish.title": "发布到社区",
"authorize.scenes.sandbox.subtitle": "创建社区个人档案,即可在社区沙箱中运行该工具。",
"authorize.scenes.sandbox.title": "试用社区沙箱",
- "authorize.subtitle": "创建社区个人档案,以便在社区上提交和管理上架信息。",
+ "authorize.subtitle": "创建社区个人档案,即可使用社区功能。",
"authorize.title": "创建社区档案",
"callback.buttons.close": "关闭窗口",
"callback.messages.authFailed": "授权失败: {{error}}",
@@ -50,8 +48,6 @@
"messages.handoffTimeout": "授权等待超时。请回到浏览器完成操作后再重试",
"messages.loading": "正在启动授权流程…",
"messages.success.cloudMcpInstall": "授权成功!现在可以安装 Cloud MCP 了。",
- "messages.success.submit": "授权成功!现在可以发布助理了。",
- "messages.success.upload": "授权成功!现在可以发布新版本了。",
"profileSetup.cancel": "取消",
"profileSetup.confirmChangeUserId.cancel": "取消",
"profileSetup.confirmChangeUserId.confirm": "确认修改",
diff --git a/locales/zh-CN/setting.json b/locales/zh-CN/setting.json
index ed9fd78d498..9a34f9985e8 100644
--- a/locales/zh-CN/setting.json
+++ b/locales/zh-CN/setting.json
@@ -440,60 +440,7 @@
"llm.proxyUrl.title": "API 代理地址",
"llm.waitingForMore": "更多模型正在 <1>计划接入</1> 中,敬请期待",
"llm.waitingForMoreLinkAriaLabel": "打开模型服务商接入需求表单",
- "marketPublish.forkConfirm.by": "作者:{{author}}",
- "marketPublish.forkConfirm.confirm": "确认发布",
- "marketPublish.forkConfirm.confirmGroup": "确认发布",
- "marketPublish.forkConfirm.description": "你即将基于社区中已存在的助理发布一个二次创作版本。你的新助理将作为独立条目发布到市场。",
- "marketPublish.forkConfirm.descriptionGroup": "您即将基于社区中已有的群组发布一个衍生版本。您的新群组将在市场中作为一个独立条目创建。",
- "marketPublish.forkConfirm.title": "发布二次创作助理",
- "marketPublish.forkConfirm.titleGroup": "发布衍生群组",
- "marketPublish.modal.changelog.extra": "描述此版本的主要变更和改进",
- "marketPublish.modal.changelog.label": "变更日志",
- "marketPublish.modal.changelog.maxLengthError": "变更日志不能超过500个字符",
- "marketPublish.modal.changelog.placeholder": "请输入变更日志",
- "marketPublish.modal.changelog.required": "请输入变更日志",
- "marketPublish.modal.comparison.local": "本地当前版本",
- "marketPublish.modal.comparison.remote": "当前发布版本",
- "marketPublish.modal.identifier.extra": "标识符将作为助理的唯一标识,建议使用小写字母、数字和连字符",
- "marketPublish.modal.identifier.label": "助理标识符",
- "marketPublish.modal.identifier.lengthError": "标识符长度应在3-50个字符之间",
- "marketPublish.modal.identifier.patternError": "标识符只能包含小写字母、数字和连字符",
- "marketPublish.modal.identifier.placeholder": "请输入助理的唯一标识符,如: web-development",
- "marketPublish.modal.identifier.required": "请输入助理标识符",
- "marketPublish.modal.loading.fetchingRemote": "正在加载远程数据…",
- "marketPublish.modal.loading.submit": "正在发布助理…",
- "marketPublish.modal.loading.submitGroup": "正在提交群组...",
- "marketPublish.modal.loading.upload": "正在发布新版本…",
- "marketPublish.modal.loading.uploadGroup": "正在发布新群组版本...",
- "marketPublish.modal.messages.createVersionFailed": "版本创建失败: {{message}}",
- "marketPublish.modal.messages.fetchRemoteFailed": "获取远程助理数据失败",
- "marketPublish.modal.messages.missingIdentifier": "当前助理还没有社区标识符",
- "marketPublish.modal.messages.noGroup": "未选择任何群组",
- "marketPublish.modal.messages.notAuthenticated": "请先登录社区账户",
- "marketPublish.modal.messages.publishFailed": "发布失败: {{message}}",
- "marketPublish.modal.submitButton": "发布",
- "marketPublish.modal.title.submit": "分享到助理社区",
- "marketPublish.modal.title.upload": "发布新版本",
- "marketPublish.resultModal.message": "你创作的助理已提交审核,审核通过后将自动上线",
- "marketPublish.resultModal.messageGroup": "您的群组已提交审核。审核通过后将自动上线。",
- "marketPublish.resultModal.title": "提交成功",
- "marketPublish.resultModal.view": "前往社区查看",
"marketPublish.status.underReview": "审核中",
- "marketPublish.submit.button": "分享到社区",
- "marketPublish.submit.tooltip": "分享助理到社区",
- "marketPublish.submitGroup.tooltip": "将此群组分享至社区",
- "marketPublish.upload.button": "发布新版本",
- "marketPublish.upload.tooltip": "发布新版本到助理社区",
- "marketPublish.uploadGroup.tooltip": "向群组社区发布新版本",
- "marketPublish.validation.communitySetupRequired.action": "立即设置",
- "marketPublish.validation.communitySetupRequired.desc": "此工作区尚未设置其社区资料。在发布到社区之前,请先完成设置。",
- "marketPublish.validation.communitySetupRequired.memberHint": "此工作区尚未设置其社区资料。请请求工作区所有者完成设置后再发布到社区。",
- "marketPublish.validation.communitySetupRequired.title": "请先设置社区资料",
- "marketPublish.validation.confirmPublish": "发布到市场?",
- "marketPublish.validation.confirmPublishDesc": "一旦发布,此内容将在市场中公开可见,任何人都可以发现并使用。",
- "marketPublish.validation.emptyName": "无法发布:名称不能为空",
- "marketPublish.validation.emptySystemRole": "无法发布:系统角色不能为空",
- "marketPublish.validation.underReview": "您的新版本正在审核中,请等待审核通过后再发布新版本。",
"memory.effort.desc": "控制 AI 检索和更新记忆的积极程度。",
"memory.effort.high": "高 — 主动检索和更新",
"memory.effort.level.high": "高",
@@ -515,14 +462,6 @@
"myAgents.actions.deprecateLoading": "正在废弃助理…",
"myAgents.actions.deprecateSuccess": "助理已废弃",
"myAgents.actions.edit": "去编辑助理",
- "myAgents.actions.publish": "上架助理",
- "myAgents.actions.publishError": "上架助理失败",
- "myAgents.actions.publishLoading": "正在上架助理…",
- "myAgents.actions.publishSuccess": "助理已上架",
- "myAgents.actions.unpublish": "下架助理",
- "myAgents.actions.unpublishError": "下架助理失败",
- "myAgents.actions.unpublishLoading": "正在下架助理…",
- "myAgents.actions.unpublishSuccess": "助理已下架",
"myAgents.actions.viewDetail": "查看详情",
"myAgents.detail.category": "分类",
"myAgents.detail.description": "描述",
@@ -587,7 +526,6 @@
"plugin.settings.title": "{{id}} 技能配置",
"plugin.settings.tooltip": "技能配置",
"plugin.store": "技能商店",
- "publishToCommunity": "发布到社区",
"serviceModel.contextLimit.placeholder": "上下文限制",
"serviceModel.memoryModels.title": "记忆模型",
"serviceModel.modelAssignments.title": "模型分配",
@@ -955,13 +893,6 @@
"storageOverage.usage.estimatedCharge": "预计本账期费用",
"storageOverage.usage.incurredCharge": "本账期已产生费用",
"storageOverage.usage.overage": "超额",
- "submitAgentModal.button": "提交助理",
- "submitAgentModal.identifier": "助理标识符(identifier)",
- "submitAgentModal.metaMiss": "请补全助理信息后提交,需要包含名称、描述和标签",
- "submitAgentModal.placeholder": "请输入助理的标识符,需要是唯一的,比如 web-development",
- "submitAgentModal.success": "助理提交成功",
- "submitAgentModal.tooltips": "分享到助理社区",
- "submitGroupModal.tooltips": "分享到群组社区",
"sync.device.deviceName.hint": "添加名称以便于识别",
"sync.device.deviceName.placeholder": "请输入设备名称",
"sync.device.deviceName.title": "设备名称",
diff --git a/packages/locales/src/default/marketAuth.ts b/packages/locales/src/default/marketAuth.ts
index 1d5d80ab34b..89f17ee817f 100644
--- a/packages/locales/src/default/marketAuth.ts
+++ b/packages/locales/src/default/marketAuth.ts
@@ -9,14 +9,10 @@ export default {
'authorize.scenes.mcp.subtitle':
'Create a community profile to install and run this skill from the community.',
'authorize.scenes.mcp.title': 'Install Community Skill',
- 'authorize.scenes.publish.subtitle':
- 'Create a community profile to publish and manage your listing within the community.',
- 'authorize.scenes.publish.title': 'Publish to the Community',
'authorize.scenes.sandbox.subtitle':
'Create a community profile to run this tool in the community sandbox.',
'authorize.scenes.sandbox.title': 'Try the Community Sandbox',
- 'authorize.subtitle':
- 'Create a community profile to submit and manage listings within the community.',
+ 'authorize.subtitle': 'Create a community profile to use community features.',
'authorize.title': 'Create Community Profile',
'callback.buttons.close': 'Close Window',
'claimResources.claim': 'Claim Selected',
@@ -61,8 +57,6 @@ export default {
'messages.loading': 'Starting authorization process...',
'messages.success.cloudMcpInstall':
'Authorization successful! You can now install the Cloud MCP skill.',
- 'messages.success.submit': 'Authorization successful! You can now publish your agent.',
- 'messages.success.upload': 'Authorization successful! You can now publish a new version.',
'profileSetup.cancel': 'Cancel',
'profileSetup.descriptionEdit': 'Update your community profile information.',
'profileSetup.descriptionFirstTime': 'Set up your profile to complete your community profile.',
diff --git a/packages/locales/src/default/setting.ts b/packages/locales/src/default/setting.ts
index 731e17c5574..a09415a5ef6 100644
--- a/packages/locales/src/default/setting.ts
+++ b/packages/locales/src/default/setting.ts
@@ -512,73 +512,7 @@ export default {
'llm.proxyUrl.title': 'API proxy URL',
'llm.waitingForMore': 'More models are <1>planned to be added</1>, stay tuned',
'llm.waitingForMoreLinkAriaLabel': 'Open the Provider request form',
- 'marketPublish.forkConfirm.by': 'by {{author}}',
- 'marketPublish.forkConfirm.confirm': 'Confirm Publish',
- 'marketPublish.forkConfirm.confirmGroup': 'Confirm Publish',
- 'marketPublish.forkConfirm.description':
- 'You are about to publish a derivative version based on an existing agent from the community. Your new agent will be created as a separate entry in the marketplace.',
- 'marketPublish.forkConfirm.descriptionGroup':
- 'You are about to publish a derivative version based on an existing group from the community. Your new group will be created as a separate entry in the marketplace.',
- 'marketPublish.forkConfirm.title': 'Publish Derivative Agent',
- 'marketPublish.forkConfirm.titleGroup': 'Publish Derivative Group',
- 'marketPublish.modal.changelog.extra':
- 'Describe the key changes and improvements in this version',
- 'marketPublish.modal.changelog.label': 'Changelog',
- 'marketPublish.modal.changelog.maxLengthError': 'Changelog must not exceed 500 characters',
- 'marketPublish.modal.changelog.placeholder': 'Enter the changelog',
- 'marketPublish.modal.changelog.required': 'Please enter the changelog',
- 'marketPublish.modal.comparison.local': 'Current Local Version',
- 'marketPublish.modal.comparison.remote': 'Currently Published Version',
- 'marketPublish.modal.identifier.extra':
- 'This is the Agent’s unique identifier. Use lowercase letters, numbers, and hyphens.',
- 'marketPublish.modal.identifier.label': 'Agent Identifier',
- 'marketPublish.modal.identifier.lengthError': 'Identifier must be between 3 and 50 characters',
- 'marketPublish.modal.identifier.patternError':
- 'Identifier can only contain lowercase letters, numbers, and hyphens',
- 'marketPublish.modal.identifier.placeholder':
- 'Enter a unique identifier for the agent, e.g., web-development',
- 'marketPublish.modal.identifier.required': 'Please enter the agent identifier',
- 'marketPublish.modal.loading.fetchingRemote': 'Loading remote data...',
- 'marketPublish.modal.loading.submit': 'Submitting Agent...',
- 'marketPublish.modal.loading.submitGroup': 'Submitting Group...',
- 'marketPublish.modal.loading.upload': 'Publishing new version...',
- 'marketPublish.modal.loading.uploadGroup': 'Publishing new group version...',
- 'marketPublish.modal.messages.createVersionFailed': 'Failed to create version: {{message}}',
- 'marketPublish.modal.messages.fetchRemoteFailed': 'Failed to fetch remote agent data',
- 'marketPublish.modal.messages.missingIdentifier':
- 'This Agent doesn’t have a Community identifier yet.',
- 'marketPublish.modal.messages.noGroup': 'No group selected',
- 'marketPublish.modal.messages.notAuthenticated': 'Sign in to your Community account first.',
- 'marketPublish.modal.messages.publishFailed': 'Publish failed: {{message}}',
- 'marketPublish.modal.submitButton': 'Publish',
- 'marketPublish.modal.title.submit': 'Share to Agent Community',
- 'marketPublish.modal.title.upload': 'Publish New Version',
- 'marketPublish.resultModal.message':
- 'Your Agent has been submitted for review. Once approved, it will go live automatically.',
- 'marketPublish.resultModal.messageGroup':
- 'Your Group has been submitted for review. Once approved, it will go live automatically.',
- 'marketPublish.resultModal.title': 'Submission Successful',
- 'marketPublish.resultModal.view': 'View in Community',
'marketPublish.status.underReview': 'Under Review',
- 'marketPublish.submit.button': 'Share to Community',
- 'marketPublish.submit.tooltip': 'Share this Agent to the Community',
- 'marketPublish.submitGroup.tooltip': 'Share this Group to the Community',
- 'marketPublish.upload.button': 'Publish New Version',
- 'marketPublish.upload.tooltip': 'Publish a new version to Agent Community',
- 'marketPublish.uploadGroup.tooltip': 'Publish a new version to Group Community',
- 'marketPublish.validation.communitySetupRequired.action': 'Set Up Now',
- 'marketPublish.validation.communitySetupRequired.desc':
- "This workspace hasn't set up its Community profile yet. Set it up before publishing to the Community.",
- 'marketPublish.validation.communitySetupRequired.memberHint':
- "This workspace hasn't set up its Community profile yet. Ask a workspace owner to set it up before publishing to the Community.",
- 'marketPublish.validation.communitySetupRequired.title': 'Set Up Community Profile First',
- 'marketPublish.validation.confirmPublish': 'Publish to the Market?',
- 'marketPublish.validation.confirmPublishDesc':
- 'Once published, this content will be publicly visible in the market and available for anyone to discover and use.',
- 'marketPublish.validation.emptyName': 'Cannot publish: Name is required',
- 'marketPublish.validation.emptySystemRole': 'Cannot publish: System Role is required',
- 'marketPublish.validation.underReview':
- 'Your new version is currently under review. Please wait for approval before publishing a new version.',
'memory.effort.desc': 'Control how aggressively the AI retrieves and updates memory.',
'memory.effort.high': 'High — Proactive retrieval and updates',
'memory.effort.level.high': 'High',
@@ -626,14 +560,6 @@ export default {
'myAgents.actions.deprecateLoading': 'Deprecating agent...',
'myAgents.actions.deprecateSuccess': 'Agent deprecated',
'myAgents.actions.edit': 'Edit Agent',
- 'myAgents.actions.publish': 'Publish Agent',
- 'myAgents.actions.publishError': 'Failed to publish agent',
- 'myAgents.actions.publishLoading': 'Publishing agent...',
- 'myAgents.actions.publishSuccess': 'Agent published',
- 'myAgents.actions.unpublish': 'Unpublish Agent',
- 'myAgents.actions.unpublishError': 'Failed to unpublish agent',
- 'myAgents.actions.unpublishLoading': 'Unpublishing agent...',
- 'myAgents.actions.unpublishSuccess': 'Agent unpublished',
'myAgents.actions.viewDetail': 'View Details',
'myAgents.detail.category': 'Category',
'myAgents.detail.description': 'Description',
@@ -662,7 +588,6 @@ export default {
'plugin.settings.title': '{{id}} Skill Configuration',
'plugin.settings.tooltip': 'Skill Configuration',
'plugin.store': 'Skill Store',
- 'publishToCommunity': 'Publish to Community',
'settingAgent.avatar.sizeExceeded': 'Image size exceeds 1MB limit, please choose a smaller image',
'settingAgent.avatar.title': 'Avatar',
'settingAgent.backgroundColor.title': 'Background Color',
@@ -1114,14 +1039,6 @@ When I am ___, I need ___
'storageOverage.usage.estimatedCharge': 'Est. Cycle Charge',
'storageOverage.usage.incurredCharge': 'Incurred This Cycle',
'storageOverage.usage.overage': 'Overage',
- 'submitAgentModal.button': 'Submit Agent',
- 'submitAgentModal.identifier': 'Agent Identifier',
- 'submitAgentModal.metaMiss':
- 'Please complete the agent information before submitting. It should include name, description, and tags',
- 'submitAgentModal.placeholder': 'Enter a unique identifier for the agent, e.g. web-development',
- 'submitAgentModal.success': 'Agent submitted successfully',
- 'submitAgentModal.tooltips': 'Share to Agent Community',
- 'submitGroupModal.tooltips': 'Share to Group Community',
'sync.device.deviceName.hint': 'Add a name for easy identification',
'sync.device.deviceName.placeholder': 'Enter device name',
'sync.device.deviceName.title': 'Device Name',
diff --git a/src/hooks/useAgentOwnershipCheck.ts b/src/hooks/useAgentOwnershipCheck.ts
deleted file mode 100644
index 4e0d6d2ac3c..00000000000
--- a/src/hooks/useAgentOwnershipCheck.ts
+++ /dev/null
@@ -1,166 +0,0 @@
-import { useEffect, useState } from 'react';
-
-import { useMarketAuth } from '@/layout/AuthProvider/MarketAuth';
-import { type MarketAuthContextType } from '@/layout/AuthProvider/MarketAuth/types';
-import { marketApiService } from '@/services/marketApi';
-import { serverConfigSelectors, useServerConfigStore } from '@/store/serverConfig';
-
-interface AgentOwnershipResult {
- // null = loading, true = user owns it, false = user doesn't own it
- error?: string;
- isOwnAgent: boolean | null;
-}
-
-// Simple cache mechanism to avoid duplicate API calls
-const agentOwnershipCache = new Map<string, { result: boolean; timestamp: number }>();
-const CACHE_DURATION = 5 * 60 * 1000; // 5-minute cache
-
-const buildCacheKey = (marketIdentifier: string, accountId?: string | number | null) =>
- `${marketIdentifier}::${accountId ?? 'unknown'}`;
-
-/**
- * Get current user ID
- */
-function getCurrentAccountId(marketAuth: MarketAuthContextType): string | number | null {
- try {
- // First try to get user info from marketAuth
- const userInfo = marketAuth.getCurrentUserInfo?.();
- if (userInfo?.accountId !== null) {
- console.info('[useAgentOwnershipCheck] User ID from userInfo:', userInfo?.accountId);
- return userInfo?.accountId ?? null;
- }
-
- // If not available, try to get from sessionStorage
- const userInfoData = sessionStorage.getItem('market_user_info');
- if (userInfoData) {
- const parsedUserInfo = JSON.parse(userInfoData);
- console.info(
- '[useAgentOwnershipCheck] User ID from sessionStorage:',
- parsedUserInfo.accountId,
- );
- return parsedUserInfo.accountId ?? parsedUserInfo.sub ?? null;
- }
-
- console.warn('[useAgentOwnershipCheck] No user ID found');
- return null;
- } catch (error) {
- console.error('[useAgentOwnershipCheck] Failed to get current user ID:', error);
- return null;
- }
-}
-
-interface CheckOwnershipParams {
- accessToken?: string;
- accountId?: string | number | null;
- /**
- * Whether trustedClient mode is enabled; when enabled, accessToken is not required
- */
- enableMarketTrustedClient?: boolean;
- marketIdentifier?: string;
- skipCache?: boolean;
-}
-
-/**
- * Verify if the current account is the owner of the specified agent
- */
-export const checkOwnership = async ({
- accountId,
- accessToken,
- enableMarketTrustedClient = false,
- marketIdentifier,
- skipCache = false,
-}: CheckOwnershipParams): Promise<boolean> => {
- // In trustedClient mode, accessToken is not required; otherwise it is required
- if (!marketIdentifier || !accountId || (!enableMarketTrustedClient && !accessToken)) {
- console.warn('[checkOwnership] Missing required parameters', {
- accessToken: Boolean(accessToken),
- accountId,
- enableMarketTrustedClient,
- marketIdentifier,
- });
- return false;
- }
-
- const cacheKey = buildCacheKey(marketIdentifier, accountId);
- const cached = agentOwnershipCache.get(cacheKey);
- if (!skipCache && cached && Date.now() - cached.timestamp < CACHE_DURATION) {
- console.info('[checkOwnership] Using cached result:', cached.result);
- return cached.result;
- }
-
- // Only set accessToken when not in trustedClient mode
- if (!enableMarketTrustedClient && accessToken) {
- marketApiService.setAccessToken(accessToken);
- }
-
- const agentDetail = await marketApiService.getAgentDetail(marketIdentifier);
- console.info('[checkOwnership] Agent detail:', agentDetail);
-
- const isOwner = `${agentDetail?.ownerId ?? ''}` === `${accountId}`;
- agentOwnershipCache.set(cacheKey, {
- result: isOwner,
- timestamp: Date.now(),
- });
-
- return isOwner;
-};
-
-/**
- * Check if the current user owns the specified agent
- */
-export const useAgentOwnershipCheck = (marketIdentifier?: string): AgentOwnershipResult => {
- const [result, setResult] = useState<AgentOwnershipResult>({ isOwnAgent: null });
- const marketAuth = useMarketAuth();
- const { isAuthenticated } = marketAuth;
-
- // Check if Market Trusted Client authentication is enabled
- const enableMarketTrustedClient = useServerConfigStore(
- serverConfigSelectors.enableMarketTrustedClient,
- );
-
- useEffect(() => {
- if (!marketIdentifier || !isAuthenticated) {
- setResult({ isOwnAgent: false });
- return;
- }
-
- const runOwnershipCheck = async () => {
- try {
- console.info('[useAgentOwnershipCheck] Checking ownership for:', marketIdentifier);
-
- // Get current user ID
- const currentAccountId = getCurrentAccountId(marketAuth);
- console.info('[useAgentOwnershipCheck] Current user ID:', currentAccountId);
-
- if (!currentAccountId) {
- console.warn('[useAgentOwnershipCheck] Could not get current user ID');
- setResult({ isOwnAgent: false });
- return;
- }
-
- // No need to get accessToken in trustedClient mode
- const accessToken = enableMarketTrustedClient
- ? undefined
- : (marketAuth.getAccessToken() ?? undefined);
-
- const isOwner = await checkOwnership({
- accessToken,
- accountId: currentAccountId,
- enableMarketTrustedClient,
- marketIdentifier,
- });
-
- setResult({ isOwnAgent: isOwner });
- } catch (error) {
- setResult({
- error: error instanceof Error ? error.message : 'Unknown error',
- isOwnAgent: false,
- });
- }
- };
-
- runOwnershipCheck();
- }, [marketIdentifier, isAuthenticated, marketAuth, enableMarketTrustedClient]);
-
- return result;
-};
diff --git a/src/hooks/useCommunityPublishGuard.tsx b/src/hooks/useCommunityPublishGuard.tsx
deleted file mode 100644
index 0375d7e50a1..00000000000
--- a/src/hooks/useCommunityPublishGuard.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-import { App } from 'antd';
-import { useCallback } from 'react';
-import { useTranslation } from 'react-i18next';
-
-import { useCommunityWorkspaceProfile } from '@/business/client/hooks/useCommunityWorkspaceProfile';
-import { message } from '@/components/AntdStaticMethods';
-import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';
-
-/**
- * Guards Community publishing inside a workspace. A workspace can only publish
- * to the Community after its owner has set up the workspace's Community
- * organization identity. Returns a checker that surfaces an actionable prompt
- * and returns `false` when setup is still required.
- *
- * Outside a workspace (`isWorkspaceScope` is false) the checker is always a
- * no-op that returns `true`, so open-source builds are unaffected.
- */
-export const useCommunityPublishGuard = () => {
- const { t } = useTranslation('setting');
- const { modal } = App.useApp();
- const navigate = useWorkspaceAwareNavigate();
- const { canEdit, isLoading, isWorkspaceScope, profile } = useCommunityWorkspaceProfile();
-
- return useCallback((): boolean => {
- // Not in a workspace, still loading, or the org identity already exists.
- if (!isWorkspaceScope || isLoading || profile) return true;
-
- if (canEdit) {
- modal.confirm({
- centered: true,
- content: t('marketPublish.validation.communitySetupRequired.desc'),
- okButtonProps: { type: 'primary' },
- okText: t('marketPublish.validation.communitySetupRequired.action'),
- onOk: () => navigate('/community/workspace'),
- title: t('marketPublish.validation.communitySetupRequired.title'),
- });
- } else {
- message.warning(t('marketPublish.validation.communitySetupRequired.memberHint'));
- }
-
- return false;
- }, [canEdit, isLoading, isWorkspaceScope, profile, modal, navigate, t]);
-};
diff --git a/src/layout/AuthProvider/MarketAuth/scenes.test.ts b/src/layout/AuthProvider/MarketAuth/scenes.test.ts
index 2c00f343c8c..f33ce538c16 100644
--- a/src/layout/AuthProvider/MarketAuth/scenes.test.ts
+++ b/src/layout/AuthProvider/MarketAuth/scenes.test.ts
@@ -12,13 +12,10 @@ describe('pathToMarketAuthScene', () => {
expect(pathToMarketAuthScene('market.installCloudMcp')).toBe('mcp');
});
- it('maps publish/submit paths to the publish scene', () => {
- expect(pathToMarketAuthScene('market.publishAgent')).toBe('publish');
- expect(pathToMarketAuthScene('market.submitVersion')).toBe('publish');
- });
-
it('falls back to the default scene for unknown paths', () => {
expect(pathToMarketAuthScene('market.followUser')).toBe('default');
expect(pathToMarketAuthScene('market.getUserProfile')).toBe('default');
+ expect(pathToMarketAuthScene('market.publishAgent')).toBe('default');
+ expect(pathToMarketAuthScene('market.submitVersion')).toBe('default');
});
});
diff --git a/src/layout/AuthProvider/MarketAuth/scenes.ts b/src/layout/AuthProvider/MarketAuth/scenes.ts
index d293ca1d1d7..29ba8324596 100644
--- a/src/layout/AuthProvider/MarketAuth/scenes.ts
+++ b/src/layout/AuthProvider/MarketAuth/scenes.ts
@@ -2,12 +2,11 @@
* Market Auth Scenes
*
* The Market auth modal can be triggered from different capabilities (running a
- * tool in the sandbox, installing a Cloud MCP skill, publishing to the
- * community, ...). The `scene` lets the modal show capability-specific copy
+ * tool in the sandbox, installing a Cloud MCP skill, ...). The `scene` lets the modal show capability-specific copy
* while falling back to the generic community-profile copy when unknown.
*/
-export type MarketAuthScene = 'default' | 'sandbox' | 'mcp' | 'publish';
+export type MarketAuthScene = 'default' | 'sandbox' | 'mcp';
/**
* Infer the scene from a tRPC procedure path (e.g. `market.execInSandbox`).
@@ -16,6 +15,5 @@ export type MarketAuthScene = 'default' | 'sandbox' | 'mcp' | 'publish';
export const pathToMarketAuthScene = (path: string): MarketAuthScene => {
if (path.includes('execInSandbox')) return 'sandbox';
if (path.includes('CloudMcp') || path.includes('callCloudMcpEndpoint')) return 'mcp';
- if (path.includes('publish') || path.includes('submit')) return 'publish';
return 'default';
};
diff --git a/src/routes/(main)/agent/profile/features/Header/AgentPublishButton/ForkConfirmModal.tsx b/src/routes/(main)/agent/profile/features/Header/AgentPublishButton/ForkConfirmModal.tsx
deleted file mode 100644
index 891059a3aef..00000000000
--- a/src/routes/(main)/agent/profile/features/Header/AgentPublishButton/ForkConfirmModal.tsx
+++ /dev/null
@@ -1,67 +0,0 @@
-'use client';
-
-import { Avatar, Flexbox, Modal } from '@lobehub/ui';
-import { memo } from 'react';
-import { useTranslation } from 'react-i18next';
-
-interface OriginalAgentInfo {
- author?: {
- avatar?: string;
- name?: string;
- userName?: string;
- };
- avatar?: string;
- identifier: string;
- name: string;
-}
-
-interface ForkConfirmModalProps {
- loading?: boolean;
- onCancel: () => void;
- onConfirm: () => void;
- open: boolean;
- originalAgent: OriginalAgentInfo | null;
-}
-
-const ForkConfirmModal = memo<ForkConfirmModalProps>(
- ({ open, onCancel, onConfirm, originalAgent, loading }) => {
- const { t } = useTranslation('setting');
-
- if (!originalAgent) return null;
-
- const authorName = originalAgent.author?.name || originalAgent.author?.userName || 'Unknown';
-
- return (
- <Modal
- centered
- closable
- cancelText={t('cancel', { ns: 'common' })}
- confirmLoading={loading}
- okText={t('marketPublish.forkConfirm.confirm')}
- open={open}
- title={t('marketPublish.forkConfirm.title')}
- width={480}
- onCancel={onCancel}
- onOk={onConfirm}
- >
- <Flexbox gap={16} style={{ marginTop: 16 }}>
- <Flexbox horizontal align="center" gap={12}>
- <Avatar avatar={originalAgent.avatar} size={48} style={{ flex: 'none' }} />
- <Flexbox gap={4}>
- <div style={{ fontWeight: 500 }}>{originalAgent.name}</div>
- <div style={{ fontSize: 12, opacity: 0.6 }}>
- {t('marketPublish.forkConfirm.by', { author: authorName })}
- </div>
- </Flexbox>
- </Flexbox>
-
- <p style={{ lineHeight: 1.6, margin: 0 }}>{t('marketPublish.forkConfirm.description')}</p>
- </Flexbox>
- </Modal>
- );
- },
-);
-
-ForkConfirmModal.displayName = 'ForkConfirmModal';
-
-export default ForkConfirmModal;
diff --git a/src/routes/(main)/agent/profile/features/Header/AgentPublishButton/PublishButton.tsx b/src/routes/(main)/agent/profile/features/Header/AgentPublishButton/PublishButton.tsx
deleted file mode 100644
index 246165b08ca..00000000000
--- a/src/routes/(main)/agent/profile/features/Header/AgentPublishButton/PublishButton.tsx
+++ /dev/null
@@ -1,188 +0,0 @@
-import { Button } from '@lobehub/ui';
-import { ShapesUploadIcon } from '@lobehub/ui/icons';
-import { Popconfirm } from 'antd';
-import isEqual from 'fast-deep-equal';
-import { memo, useCallback, useMemo, useState } from 'react';
-import { useTranslation } from 'react-i18next';
-
-import { message } from '@/components/AntdStaticMethods';
-import { usePermission } from '@/hooks/usePermission';
-import { useMarketAuth } from '@/layout/AuthProvider/MarketAuth';
-import { resolveMarketAuthError } from '@/layout/AuthProvider/MarketAuth/errors';
-import { useAgentStore } from '@/store/agent';
-import { agentSelectors } from '@/store/agent/selectors';
-
-import { useVersionReviewStatus } from '../AgentVersionReviewTag';
-import ForkConfirmModal from './ForkConfirmModal';
-import type { MarketPublishAction } from './types';
-import { type OriginalAgentInfo, useMarketPublish } from './useMarketPublish';
-
-interface MarketPublishButtonProps {
- action: MarketPublishAction;
- onPublishSuccess?: (identifier: string) => void;
-}
-
-const PublishButton = memo<MarketPublishButtonProps>(({ action, onPublishSuccess }) => {
- const { t } = useTranslation(['setting', 'marketAuth']);
- const { allowed: canEdit } = usePermission('edit_own_content');
-
- const { isAuthenticated, isLoading, signIn } = useMarketAuth();
- const { checkOwnership, isCheckingOwnership, isPublishing, publish } = useMarketPublish({
- action,
- onSuccess: onPublishSuccess,
- });
-
- // Check if latest version is under review
- const { isUnderReview, loading: reviewStatusLoading } = useVersionReviewStatus();
-
- // Agent data for validation
- const meta = useAgentStore(agentSelectors.currentAgentMeta, isEqual);
- const systemRole = useAgentStore(agentSelectors.currentAgentSystemRole);
-
- // Fork confirmation modal state
- const [showForkModal, setShowForkModal] = useState(false);
- const [originalAgentInfo, setOriginalAgentInfo] = useState<OriginalAgentInfo | null>(null);
-
- // Publish confirmation popconfirm state
- const [confirmOpened, setConfirmOpened] = useState(false);
-
- const buttonConfig = useMemo(() => {
- if (action === 'upload') {
- return {
- authenticated: t('marketPublish.upload.tooltip'),
- unauthenticated: t('marketPublish.upload.tooltip'),
- } as const;
- }
-
- const submitText = t('submitAgentModal.tooltips');
-
- return {
- authenticated: submitText,
- unauthenticated: t('marketPublish.submit.tooltip'),
- } as const;
- }, [action, t]);
-
- const doPublish = useCallback(async () => {
- // Check ownership before publishing
- const { needsForkConfirm, originalAgent } = await checkOwnership();
-
- if (needsForkConfirm && originalAgent) {
- // Show fork confirmation modal
- setOriginalAgentInfo(originalAgent);
- setShowForkModal(true);
- return;
- }
-
- // No confirmation needed, proceed with publish
- await publish();
- }, [checkOwnership, publish]);
-
- const handleButtonClick = useCallback(() => {
- // Check if version is under review
- if (isUnderReview) {
- message.warning({
- content: t('marketPublish.validation.underReview', {
- defaultValue:
- 'Your new version is currently under review. Please wait for approval before publishing a new version.',
- }),
- });
- return;
- }
-
- // Validate name and systemRole
- if (!meta?.title || meta.title.trim() === '') {
- message.error({ content: t('marketPublish.validation.emptyName') });
- return;
- }
-
- if (!systemRole || systemRole.trim() === '') {
- message.error({ content: t('marketPublish.validation.emptySystemRole') });
- return;
- }
-
- // Open popconfirm for user confirmation
- setConfirmOpened(true);
- }, [isUnderReview, meta?.title, systemRole, t]);
-
- const handleConfirmPublish = useCallback(async () => {
- setConfirmOpened(false);
-
- if (!isAuthenticated) {
- try {
- await signIn('publish');
- // After authentication, proceed with ownership check and publish
- await doPublish();
- } catch (error) {
- console.error(`[MarketPublishButton][${action}] Authorization failed:`, error);
- const normalizedError = resolveMarketAuthError(error);
- message.error({
- content: t(`errors.${normalizedError.code}`, { ns: 'marketAuth' }),
- key: 'market-auth',
- });
- }
- return;
- }
-
- // User is authenticated, check ownership and publish
- await doPublish();
- }, [action, doPublish, isAuthenticated, signIn, t]);
-
- const handleForkConfirm = useCallback(async () => {
- setShowForkModal(false);
- setOriginalAgentInfo(null);
- // User confirmed, proceed with publish
- await publish();
- }, [publish]);
-
- const handleForkCancel = useCallback(() => {
- setShowForkModal(false);
- setOriginalAgentInfo(null);
- }, []);
-
- const buttonTitle = isAuthenticated ? buttonConfig.authenticated : buttonConfig.unauthenticated;
- const loading = isLoading || isCheckingOwnership || isPublishing || reviewStatusLoading;
-
- return (
- <>
- <Popconfirm
- arrow={false}
- okButtonProps={{ type: 'primary' }}
- open={confirmOpened}
- placement="bottomRight"
- title={t('marketPublish.validation.confirmPublish')}
- onCancel={() => setConfirmOpened(false)}
- onConfirm={handleConfirmPublish}
- onOpenChange={(open) => {
- if (!open) {
- setConfirmOpened(false);
- }
- }}
- >
- <Button
- disabled={!canEdit}
- icon={ShapesUploadIcon}
- loading={loading}
- title={buttonTitle}
- onClick={() => {
- if (!canEdit) return;
-
- handleButtonClick();
- }}
- >
- {t('publishToCommunity')}
- </Button>
- </Popconfirm>
- <ForkConfirmModal
- loading={isPublishing}
- open={showForkModal}
- originalAgent={originalAgentInfo}
- onCancel={handleForkCancel}
- onConfirm={handleForkConfirm}
- />
- </>
- );
-});
-
-PublishButton.displayName = 'MarketPublishButton';
-
-export default PublishButton;
diff --git a/src/routes/(main)/agent/profile/features/Header/AgentPublishButton/PublishResultModal.tsx b/src/routes/(main)/agent/profile/features/Header/AgentPublishButton/PublishResultModal.tsx
deleted file mode 100644
index 81da24e2b10..00000000000
--- a/src/routes/(main)/agent/profile/features/Header/AgentPublishButton/PublishResultModal.tsx
+++ /dev/null
@@ -1,61 +0,0 @@
-'use client';
-
-import { FluentEmoji, Modal, Text } from '@lobehub/ui';
-import { Result } from 'antd';
-import { memo } from 'react';
-import { useTranslation } from 'react-i18next';
-
-import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';
-
-interface PublishResultModalProps {
- identifier?: string;
- onCancel: () => void;
- open: boolean;
-}
-
-const PublishResultModal = memo<PublishResultModalProps>(({ identifier, onCancel, open }) => {
- const navigate = useWorkspaceAwareNavigate();
- const { t } = useTranslation('setting');
- const { t: tCommon } = useTranslation('common');
-
- const handleGoToMarket = () => {
- if (identifier) {
- navigate(`/community/agent/${identifier}`);
- }
- onCancel();
- };
-
- return (
- <Modal
- centered
- cancelText={tCommon('cancel')}
- okText={t('marketPublish.resultModal.view')}
- open={open}
- title={null}
- width={440}
- onCancel={onCancel}
- onOk={handleGoToMarket}
- >
- <Result
- icon={<FluentEmoji emoji={'🎉'} size={96} type={'anim'} />}
- style={{
- paddingBottom: 32,
- paddingTop: 48,
- width: '100%',
- }}
- subTitle={
- <Text fontSize={14} type={'secondary'}>
- {t('marketPublish.resultModal.message')}
- </Text>
- }
- title={
- <Text fontSize={28} weight={'bold'}>
- {t('marketPublish.resultModal.title')}
- </Text>
- }
- />
- </Modal>
- );
-});
-
-export default PublishResultModal;
diff --git a/src/routes/(main)/agent/profile/features/Header/AgentPublishButton/types.ts b/src/routes/(main)/agent/profile/features/Header/AgentPublishButton/types.ts
deleted file mode 100644
index f1378b670cf..00000000000
--- a/src/routes/(main)/agent/profile/features/Header/AgentPublishButton/types.ts
+++ /dev/null
@@ -1 +0,0 @@
-export type MarketPublishAction = 'submit' | 'upload';
diff --git a/src/routes/(main)/agent/profile/features/Header/AgentPublishButton/useMarketPublish.ts b/src/routes/(main)/agent/profile/features/Header/AgentPublishButton/useMarketPublish.ts
deleted file mode 100644
index 8e21c877197..00000000000
--- a/src/routes/(main)/agent/profile/features/Header/AgentPublishButton/useMarketPublish.ts
+++ /dev/null
@@ -1,223 +0,0 @@
-import isEqual from 'fast-deep-equal';
-import { useCallback, useRef, useState } from 'react';
-import { useTranslation } from 'react-i18next';
-
-import { useHasActiveWorkspace } from '@/business/client/hooks/useHasActiveWorkspace';
-import { message } from '@/components/AntdStaticMethods';
-import { useTokenCount } from '@/hooks/useTokenCount';
-import { useMarketAuth } from '@/layout/AuthProvider/MarketAuth';
-import { lambdaClient } from '@/libs/trpc/client';
-import { useAgentStore } from '@/store/agent';
-import { agentChatConfigSelectors, agentSelectors } from '@/store/agent/selectors';
-import { useGlobalStore } from '@/store/global';
-import { globalGeneralSelectors } from '@/store/global/selectors';
-
-import { type MarketPublishAction } from './types';
-import { generateDefaultChangelog } from './utils';
-
-export interface OriginalAgentInfo {
- author?: {
- avatar?: string;
- name?: string;
- userName?: string;
- };
- avatar?: string;
- identifier: string;
- name: string;
-}
-
-interface UseMarketPublishOptions {
- action: MarketPublishAction;
- onSuccess?: (identifier: string) => void;
-}
-
-export interface CheckOwnershipResult {
- needsForkConfirm: boolean;
- originalAgent: OriginalAgentInfo | null;
-}
-
-export const useMarketPublish = ({ action, onSuccess }: UseMarketPublishOptions) => {
- const { t } = useTranslation('setting');
- const [isPublishing, setIsPublishing] = useState(false);
- const [isCheckingOwnership, setIsCheckingOwnership] = useState(false);
- // Use ref to synchronously track publishing state and avoid race conditions caused by closures
- const isPublishingRef = useRef(false);
- const { isAuthenticated } = useMarketAuth();
-
- // Agent data from store
- const meta = useAgentStore(agentSelectors.currentAgentMeta, isEqual);
- const updateAgentMeta = useAgentStore((s) => s.updateAgentMeta);
- const systemRole = useAgentStore(agentSelectors.currentAgentSystemRole);
- const config = useAgentStore(agentSelectors.currentAgentConfig, isEqual);
- const editorData = config?.editorData;
- const language = useGlobalStore(globalGeneralSelectors.currentLanguage);
- const agentConfig = useAgentStore(agentSelectors.currentAgentConfig);
- const chatConfig = useAgentStore(agentChatConfigSelectors.currentChatConfig);
- const plugins = useAgentStore(agentSelectors.currentAgentPlugins);
- const model = useAgentStore(agentSelectors.currentAgentModel);
- const provider = useAgentStore(agentSelectors.currentAgentModelProvider);
- const tokenUsage = useTokenCount(systemRole);
- const hasActiveWorkspace = useHasActiveWorkspace();
-
- const isSubmit = action === 'submit';
-
- /**
- * Check ownership before publishing
- * Returns whether fork confirmation is needed and original agent info
- */
- const checkOwnership = useCallback(async (): Promise<CheckOwnershipResult> => {
- const identifier = meta?.marketIdentifier;
-
- // No identifier means new agent, no need to check
- if (!identifier) {
- return { needsForkConfirm: false, originalAgent: null };
- }
-
- try {
- setIsCheckingOwnership(true);
- const result = await lambdaClient.market.agent.checkOwnership.query({ identifier });
-
- // If agent doesn't exist or user is owner, no confirmation needed
- if (!result.exists || result.isOwner) {
- return { needsForkConfirm: false, originalAgent: null };
- }
-
- // User is not owner, need fork confirmation
- return {
- needsForkConfirm: true,
- originalAgent: result.originalAgent as OriginalAgentInfo,
- };
- } catch (error) {
- console.error('[useMarketPublish] Failed to check ownership:', error);
- // On error, proceed without confirmation
- return { needsForkConfirm: false, originalAgent: null };
- } finally {
- setIsCheckingOwnership(false);
- }
- }, [meta?.marketIdentifier]);
-
- const publish = useCallback(async () => {
- // Prevent duplicate publishing: use ref for synchronous check to avoid race conditions from closures
- if (isPublishingRef.current) {
- return { success: false };
- }
-
- // Check authentication state - tRPC handles trustedClient automatically
- if (!isAuthenticated) {
- return { success: false };
- }
-
- const messageKey = isSubmit ? 'submit' : 'upload-version';
- const loadingMessage = isSubmit
- ? t('marketPublish.modal.loading.submit')
- : t('marketPublish.modal.loading.upload');
-
- const changelog = generateDefaultChangelog();
-
- try {
- // Set ref immediately to prevent duplicate calls
- isPublishingRef.current = true;
- setIsPublishing(true);
- message.loading({ content: loadingMessage, key: messageKey });
- const actAs = hasActiveWorkspace
- ? (await lambdaClient.workspace.ensureMarketOrganization.mutate()).marketAccountId
- : undefined;
-
- // Use tRPC publishOrCreate - backend handles ownership check automatically
- const result = await lambdaClient.market.agent.publishOrCreate.mutate({
- actAs,
- avatar: meta?.avatar,
- changelog,
- config: {
- chatConfig: {
- enableHistoryCount: chatConfig?.enableHistoryCount,
- historyCount: chatConfig?.historyCount,
- maxTokens: agentConfig?.params?.max_tokens,
- searchMode: chatConfig?.searchMode,
- temperature: agentConfig?.params?.temperature,
- topP: agentConfig?.params?.top_p,
- },
- description: meta?.description,
- locale: language,
- model: {
- model,
- parameters: agentConfig?.params,
- provider,
- },
- plugins:
- plugins?.map((plugin) => {
- if (typeof plugin === 'string') {
- return plugin;
- } else {
- return null;
- }
- }) || [],
- systemRole,
- },
- description: meta?.description || '',
- editorData,
- // Pass existing identifier; backend will check ownership
- identifier: meta?.marketIdentifier,
- name: meta?.title || '',
- tags: meta?.tags,
- tokenUsage,
- });
-
- // If a new agent was created, update meta with the new identifier
- if (result.isNewAgent) {
- updateAgentMeta({ marketIdentifier: result.identifier });
- }
-
- message.success({
- content: t('submitAgentModal.success'),
- key: messageKey,
- });
-
- onSuccess?.(result.identifier);
- return { identifier: result.identifier, success: true };
- } catch (error) {
- const errorMessage =
- error instanceof Error ? error.message : t('unknownError', { ns: 'common' });
- message.error({
- content: t('marketPublish.modal.messages.publishFailed', {
- message: errorMessage,
- }),
- key: messageKey,
- });
- return { success: false };
- } finally {
- isPublishingRef.current = false;
- setIsPublishing(false);
- }
- }, [
- agentConfig?.params,
- chatConfig?.enableHistoryCount,
- chatConfig?.historyCount,
- chatConfig?.searchMode,
- editorData,
- hasActiveWorkspace,
- isAuthenticated,
- isSubmit,
- language,
- meta?.avatar,
- meta?.description,
- meta?.marketIdentifier,
- meta?.tags,
- meta?.title,
- model,
- onSuccess,
- plugins,
- provider,
- systemRole,
- tokenUsage,
- t,
- updateAgentMeta,
- ]);
-
- return {
- checkOwnership,
- isCheckingOwnership,
- isPublishing,
- publish,
- };
-};
diff --git a/src/routes/(main)/agent/profile/features/Header/AgentPublishButton/utils.ts b/src/routes/(main)/agent/profile/features/Header/AgentPublishButton/utils.ts
deleted file mode 100644
index 877a3a75479..00000000000
--- a/src/routes/(main)/agent/profile/features/Header/AgentPublishButton/utils.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { customAlphabet } from 'nanoid/non-secure';
-
-/**
- * Generate a market identifier (8-character lowercase alphanumeric string)
- * Format: [a-z0-9]{8}
- * @returns A unique 8-character market identifier
- */
-export const generateMarketIdentifier = () => {
- const alphabet = '0123456789abcdefghijklmnopqrstuvwxyz';
- const generate = customAlphabet(alphabet, 8);
- return generate();
-};
-
-/**
- * Generate a default changelog based on current timestamp
- * @returns A timestamp-based changelog string
- */
-export const generateDefaultChangelog = () => {
- const now = new Date();
- const formattedDate = now.toISOString().split('T')[0];
- return `Release ${formattedDate}`;
-};
diff --git a/src/routes/(main)/agent/profile/features/Header/PublishConfirmModal.tsx b/src/routes/(main)/agent/profile/features/Header/PublishConfirmModal.tsx
deleted file mode 100644
index 972c9557168..00000000000
--- a/src/routes/(main)/agent/profile/features/Header/PublishConfirmModal.tsx
+++ /dev/null
@@ -1,55 +0,0 @@
-'use client';
-
-import { Button, Flexbox, Text } from '@lobehub/ui';
-import { createModal, useModalContext } from '@lobehub/ui/base-ui';
-import { t } from 'i18next';
-import { memo, useState } from 'react';
-import { useTranslation } from 'react-i18next';
-
-interface PublishConfirmContentProps {
- onConfirm: () => Promise<void>;
-}
-
-const PublishConfirmContent = memo<PublishConfirmContentProps>(({ onConfirm }) => {
- const { t: tt } = useTranslation(['setting', 'common']);
- const { close } = useModalContext();
- const [loading, setLoading] = useState(false);
-
- const handleOk = async () => {
- try {
- setLoading(true);
- await onConfirm();
- } finally {
- setLoading(false);
- close();
- }
- };
-
- return (
- <Flexbox gap={20}>
- <Text type="secondary">
- {tt('marketPublish.validation.confirmPublishDesc', { ns: 'setting' })}
- </Text>
- <Flexbox horizontal gap={8} justify="flex-end">
- <Button onClick={close}>{tt('cancel', { ns: 'common' })}</Button>
- <Button loading={loading} type="primary" onClick={handleOk}>
- {tt('ok', { ns: 'common' })}
- </Button>
- </Flexbox>
- </Flexbox>
- );
-});
-
-PublishConfirmContent.displayName = 'PublishConfirmContent';
-
-export const openPublishConfirmModal = (onConfirm: () => Promise<void>) =>
- createModal({
- content: <PublishConfirmContent onConfirm={onConfirm} />,
- styles: {
- close: { flexShrink: 0 },
- header: { gap: 8 },
- title: { flex: 1, minWidth: 0 },
- },
- title: t('marketPublish.validation.confirmPublish', { ns: 'setting' }),
- width: 420,
- });
diff --git a/src/routes/(main)/agent/profile/features/Header/index.test.tsx b/src/routes/(main)/agent/profile/features/Header/index.test.tsx
index 94cf57e56cd..f0a130cf70b 100644
--- a/src/routes/(main)/agent/profile/features/Header/index.test.tsx
+++ b/src/routes/(main)/agent/profile/features/Header/index.test.tsx
@@ -7,7 +7,6 @@ import Header from './index';
const mocks = vi.hoisted(() => ({
agentState: {
activeAgentId: 'agent-1',
- canCurrentAgentPublishToCommunity: true,
config: {
model: 'gpt-4o',
plugins: ['lobe-web-browsing'],
@@ -29,24 +28,11 @@ const mocks = vi.hoisted(() => ({
homeState: {
removeAgent: vi.fn(),
},
- marketAuth: {
- status: 'ACTIVE',
- isLoading: false,
- signIn: vi.fn(),
- },
- marketPublish: {
- checkOwnership: vi.fn(),
- isPublishing: false,
- publish: vi.fn(),
- },
navigate: vi.fn(),
profileState: {
editor: undefined as { getDocument: (format: string) => string | undefined } | undefined,
lockState: { holderId: null as string | null, lockedByOther: false, pending: false },
},
- versionReviewStatus: {
- isUnderReview: false,
- },
}));
vi.mock('@lobechat/const', () => ({
@@ -92,10 +78,6 @@ vi.mock('@lobehub/ui', () => ({
Icon: () => <span />,
}));
-vi.mock('@lobehub/ui/icons', () => ({
- ShapesUploadIcon: () => null,
-}));
-
vi.mock('@lobehub/ui/base-ui', () => ({
confirmModal: vi.fn(),
}));
@@ -156,14 +138,6 @@ vi.mock('@/features/RightPanel/ToggleRightPanelButton', () => ({
default: () => <button type="button">agentBuilder</button>,
}));
-vi.mock('@/layout/AuthProvider/MarketAuth', () => ({
- useMarketAuth: () => mocks.marketAuth,
-}));
-
-vi.mock('@/layout/AuthProvider/MarketAuth/errors', () => ({
- resolveMarketAuthError: () => ({ code: 'unknown' }),
-}));
-
vi.mock('@/store/agent', () => ({
useAgentStore: (selector: (state: typeof mocks.agentState) => unknown) =>
selector(mocks.agentState),
@@ -171,8 +145,6 @@ vi.mock('@/store/agent', () => ({
vi.mock('@/store/agent/selectors', () => ({
agentSelectors: {
- canCurrentAgentPublishToCommunity: (state: typeof mocks.agentState) =>
- state.canCurrentAgentPublishToCommunity,
currentAgentConfig: (state: typeof mocks.agentState) => state.config,
currentAgentMeta: (state: typeof mocks.agentState) => state.meta,
currentAgentSystemRole: (state: typeof mocks.agentState) => state.systemRole,
@@ -211,18 +183,6 @@ vi.mock('./AgentForkTag', () => ({
default: () => null,
}));
-vi.mock('./AgentPublishButton/ForkConfirmModal', () => ({
- default: () => null,
-}));
-
-vi.mock('./AgentPublishButton/PublishResultModal', () => ({
- default: () => null,
-}));
-
-vi.mock('./AgentPublishButton/useMarketPublish', () => ({
- useMarketPublish: () => mocks.marketPublish,
-}));
-
vi.mock('./AgentStatusTag', () => ({
default: () => null,
}));
@@ -233,7 +193,6 @@ vi.mock('./AutoSaveHint', () => ({
vi.mock('./AgentVersionReviewTag', () => ({
default: () => null,
- useVersionReviewStatus: () => mocks.versionReviewStatus,
}));
describe('Agent profile Header', () => {
@@ -241,17 +200,10 @@ describe('Agent profile Header', () => {
vi.spyOn(HTMLAnchorElement.prototype, 'click').mockImplementation(() => {});
vi.spyOn(URL, 'createObjectURL').mockReturnValue('blob:agent-profile');
vi.spyOn(URL, 'revokeObjectURL').mockImplementation(() => {});
- mocks.agentState.canCurrentAgentPublishToCommunity = true;
mocks.agentState.isCurrentAgentHeterogeneous = false;
mocks.profileState.editor = undefined;
});
- it('should show the community publish action for normal agents', () => {
- render(<Header />);
-
- expect(screen.getByRole('button', { name: 'publishToCommunity' })).toBeInTheDocument();
- });
-
it('should show the markdown export action', () => {
render(<Header />);
@@ -293,13 +245,4 @@ describe('Agent profile Header', () => {
expect(exportedMarkdown).not.toContain('You are helpful.');
expect(exportedMarkdown).not.toContain('settingAgent.prompt.title');
});
-
- it('should hide the community publish action for heterogeneous and platform agents', () => {
- mocks.agentState.canCurrentAgentPublishToCommunity = false;
- mocks.agentState.isCurrentAgentHeterogeneous = true;
-
- render(<Header />);
-
- expect(screen.queryByRole('button', { name: 'publishToCommunity' })).not.toBeInTheDocument();
- });
});
diff --git a/src/routes/(main)/agent/profile/features/Header/index.tsx b/src/routes/(main)/agent/profile/features/Header/index.tsx
index d1f66bc6ece..1195d660bc5 100644
--- a/src/routes/(main)/agent/profile/features/Header/index.tsx
+++ b/src/routes/(main)/agent/profile/features/Header/index.tsx
@@ -1,11 +1,10 @@
import { isDesktop } from '@lobechat/const';
import { ActionIcon, DropdownMenu, Flexbox, Icon } from '@lobehub/ui';
import { confirmModal } from '@lobehub/ui/base-ui';
-import { ShapesUploadIcon } from '@lobehub/ui/icons';
import isEqual from 'fast-deep-equal';
import type { TFunction } from 'i18next';
import { BotMessageSquareIcon, Download, MoreHorizontal, Settings2Icon, Trash } from 'lucide-react';
-import { memo, useCallback, useMemo, useState } from 'react';
+import { memo, useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { useAgentTransferMenuItem } from '@/business/client/hooks/useAgentTransferMenuItem';
@@ -15,10 +14,7 @@ import { DESKTOP_HEADER_ICON_SMALL_SIZE } from '@/const/layoutTokens';
import NavHeader from '@/features/NavHeader';
import ToggleRightPanelButton from '@/features/RightPanel/ToggleRightPanelButton';
import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';
-import { useCommunityPublishGuard } from '@/hooks/useCommunityPublishGuard';
import { usePermission } from '@/hooks/usePermission';
-import { useMarketAuth } from '@/layout/AuthProvider/MarketAuth';
-import { resolveMarketAuthError } from '@/layout/AuthProvider/MarketAuth/errors';
import { useAgentStore } from '@/store/agent';
import { agentSelectors } from '@/store/agent/selectors';
import { useGlobalStore } from '@/store/global';
@@ -28,18 +24,11 @@ import { sanitizeFileName } from '@/utils/sanitizeFileName';
import { selectors as profileSelectors, useProfileStore } from '../store';
import AgentForkTag from './AgentForkTag';
-import ForkConfirmModal from './AgentPublishButton/ForkConfirmModal';
-import PublishResultModal from './AgentPublishButton/PublishResultModal';
-import { type OriginalAgentInfo, useMarketPublish } from './AgentPublishButton/useMarketPublish';
import AgentStatusTag from './AgentStatusTag';
-import AgentVersionReviewTag, { useVersionReviewStatus } from './AgentVersionReviewTag';
+import AgentVersionReviewTag from './AgentVersionReviewTag';
import AutoSaveHint from './AutoSaveHint';
-import { openPublishConfirmModal } from './PublishConfirmModal';
-type HeaderTranslation = TFunction<
- readonly ['setting', 'marketAuth', 'chat', 'file', 'common'],
- undefined
->;
+type HeaderTranslation = TFunction<readonly ['setting', 'chat', 'file', 'common'], undefined>;
const buildAgentProfileMarkdown = (params: {
description?: string;
@@ -91,7 +80,7 @@ const buildAgentProfileMarkdown = (params: {
};
const Header = memo(() => {
- const { t } = useTranslation(['setting', 'marketAuth', 'chat', 'file', 'common']);
+ const { t } = useTranslation(['setting', 'chat', 'file', 'common']);
const navigate = useWorkspaceAwareNavigate();
const meta = useAgentStore(agentSelectors.currentAgentMeta, isEqual);
@@ -99,7 +88,6 @@ const Header = memo(() => {
const systemRole = useAgentStore(agentSelectors.currentAgentSystemRole);
const activeAgentId = useAgentStore((s) => s.activeAgentId);
const isHeterogeneous = useAgentStore(agentSelectors.isCurrentAgentHeterogeneous);
- const canPublishToCommunity = useAgentStore(agentSelectors.canCurrentAgentPublishToCommunity);
const [showAgentBuilderPanel, toggleAgentBuilderPanel, isStatusInit] = useGlobalStore((s) => [
systemStatusSelectors.showAgentBuilderPanel(s),
s.toggleAgentBuilderPanel,
@@ -110,99 +98,6 @@ const Header = memo(() => {
const lockedByOther = useProfileStore(profileSelectors.lockedByOther);
const lockPending = useProfileStore(profileSelectors.lockPending);
const { allowed: canEdit } = usePermission('edit_own_content');
- const { isAuthenticated, isLoading: isAuthLoading, signIn } = useMarketAuth();
- const { isUnderReview } = useVersionReviewStatus();
- const ensureCommunityPublishAllowed = useCommunityPublishGuard();
-
- const action = meta?.marketIdentifier ? 'upload' : 'submit';
-
- const [showResultModal, setShowResultModal] = useState(false);
- const [publishedIdentifier, setPublishedIdentifier] = useState<string>();
- const [showForkModal, setShowForkModal] = useState(false);
- const [originalAgentInfo, setOriginalAgentInfo] = useState<OriginalAgentInfo | null>(null);
-
- const handlePublishSuccess = useCallback((identifier: string) => {
- setPublishedIdentifier(identifier);
- setShowResultModal(true);
- }, []);
-
- const { checkOwnership, isPublishing, publish } = useMarketPublish({
- action,
- onSuccess: handlePublishSuccess,
- });
-
- const doPublish = useCallback(async () => {
- const { needsForkConfirm, originalAgent } = await checkOwnership();
- if (needsForkConfirm && originalAgent) {
- setOriginalAgentInfo(originalAgent);
- setShowForkModal(true);
- return;
- }
- await publish();
- }, [checkOwnership, publish]);
-
- const handlePublishClick = useCallback(async () => {
- if (!canEdit) return;
- if (!ensureCommunityPublishAllowed()) return;
- if (isUnderReview) {
- message.warning({
- content: t('marketPublish.validation.underReview', {
- defaultValue:
- 'Your new version is currently under review. Please wait for approval before publishing a new version.',
- ns: 'setting',
- }),
- });
- return;
- }
-
- if (!meta?.title || meta.title.trim() === '') {
- message.error({ content: t('marketPublish.validation.emptyName', { ns: 'setting' }) });
- return;
- }
-
- if (!systemRole || systemRole.trim() === '') {
- message.error({
- content: t('marketPublish.validation.emptySystemRole', { ns: 'setting' }),
- });
- return;
- }
-
- openPublishConfirmModal(async () => {
- if (!isAuthenticated) {
- try {
- await signIn('publish');
- await doPublish();
- } catch (error) {
- console.error(`[MarketPublishButton][${action}] Authorization failed:`, error);
- const normalizedError = resolveMarketAuthError(error);
- message.error({
- content: t(`errors.${normalizedError.code}`, { ns: 'marketAuth' }),
- key: 'market-auth',
- });
- }
- return;
- }
- await doPublish();
- });
- }, [
- action,
- canEdit,
- doPublish,
- ensureCommunityPublishAllowed,
- isAuthenticated,
- isUnderReview,
- meta?.title,
- signIn,
- systemRole,
- t,
- ]);
-
- const handleForkConfirm = useCallback(async () => {
- if (!canEdit) return;
- setShowForkModal(false);
- setOriginalAgentInfo(null);
- await publish();
- }, [canEdit, publish]);
const handleDelete = useCallback(() => {
if (!canEdit || !activeAgentId) return;
@@ -276,17 +171,6 @@ const Header = memo(() => {
onClick: () => useAgentStore.setState({ showAgentSetting: true }),
},
{ type: 'divider' as const },
- ...(canPublishToCommunity
- ? [
- {
- icon: <Icon icon={ShapesUploadIcon} />,
- key: 'publish',
- label: t('publishToCommunity', { ns: 'setting' }),
- onClick: handlePublishClick,
- },
- { type: 'divider' as const },
- ]
- : []),
{
children: [
{
@@ -313,64 +197,34 @@ const Header = memo(() => {
onClick: handleDelete,
},
].filter(Boolean);
- }, [
- canEdit,
- canPublishToCommunity,
- handlePublishClick,
- handleExportMarkdown,
- handleDelete,
- t,
- importMenuItem,
- transferMenuItems,
- ]);
+ }, [canEdit, handleExportMarkdown, handleDelete, t, importMenuItem, transferMenuItems]);
return (
- <>
- <NavHeader
- left={
- <Flexbox horizontal align={'center'} gap={8}>
- <AutoSaveHint />
- <AgentStatusTag />
- <AgentVersionReviewTag />
- <AgentForkTag />
- </Flexbox>
- }
- right={
- <Flexbox horizontal align={'center'} gap={4}>
- <DropdownMenu items={menuItems}>
- <ActionIcon
- icon={MoreHorizontal}
- loading={canPublishToCommunity && (isPublishing || isAuthLoading)}
- size={DESKTOP_HEADER_ICON_SMALL_SIZE}
- />
- </DropdownMenu>
- {!isHeterogeneous && isStatusInit && !lockedByOther && !lockPending && (
- <ToggleRightPanelButton
- expand={showAgentBuilderPanel}
- icon={BotMessageSquareIcon}
- showActive={true}
- onToggle={() => toggleAgentBuilderPanel()}
- />
- )}
- </Flexbox>
- }
- />
- <ForkConfirmModal
- loading={isPublishing}
- open={showForkModal}
- originalAgent={originalAgentInfo}
- onConfirm={handleForkConfirm}
- onCancel={() => {
- setShowForkModal(false);
- setOriginalAgentInfo(null);
- }}
- />
- <PublishResultModal
- identifier={publishedIdentifier}
- open={showResultModal}
- onCancel={() => setShowResultModal(false)}
- />
- </>
+ <NavHeader
+ left={
+ <Flexbox horizontal align={'center'} gap={8}>
+ <AutoSaveHint />
+ <AgentStatusTag />
+ <AgentVersionReviewTag />
+ <AgentForkTag />
+ </Flexbox>
+ }
+ right={
+ <Flexbox horizontal align={'center'} gap={4}>
+ <DropdownMenu items={menuItems}>
+ <ActionIcon icon={MoreHorizontal} size={DESKTOP_HEADER_ICON_SMALL_SIZE} />
+ </DropdownMenu>
+ {!isHeterogeneous && isStatusInit && !lockedByOther && !lockPending && (
+ <ToggleRightPanelButton
+ expand={showAgentBuilderPanel}
+ icon={BotMessageSquareIcon}
+ showActive={true}
+ onToggle={() => toggleAgentBuilderPanel()}
+ />
+ )}
+ </Flexbox>
+ }
+ />
);
});
diff --git a/src/routes/(main)/community/(detail)/user/features/DetailProvider.tsx b/src/routes/(main)/community/(detail)/user/features/DetailProvider.tsx
index ae6449669cc..0b1ea4999bc 100644
--- a/src/routes/(main)/community/(detail)/user/features/DetailProvider.tsx
+++ b/src/routes/(main)/community/(detail)/user/features/DetailProvider.tsx
@@ -24,11 +24,7 @@ export interface UserDetailContextConfig {
isOwner: boolean;
mobile?: boolean;
onEditProfile?: (onSuccess?: (profile: MarketUserProfile) => void) => void;
- onStatusChange?: (
- identifier: string,
- action: 'publish' | 'unpublish' | 'deprecate',
- type?: 'agent' | 'group',
- ) => void;
+ onStatusChange?: (identifier: string, action: 'deprecate', type?: 'agent' | 'group') => void;
plugins?: DiscoverPluginItem[];
skills?: DiscoverSkillItem[];
totalInstalls: number;
diff --git a/src/routes/(main)/community/(detail)/user/features/UserAgentCard.tsx b/src/routes/(main)/community/(detail)/user/features/UserAgentCard.tsx
index a9ee0812d61..3e15809f98a 100644
--- a/src/routes/(main)/community/(detail)/user/features/UserAgentCard.tsx
+++ b/src/routes/(main)/community/(detail)/user/features/UserAgentCard.tsx
@@ -20,8 +20,6 @@ import {
ClockIcon,
CoinsIcon,
ExternalLink,
- Eye,
- EyeOff,
GitForkIcon,
MoreVerticalIcon,
Pencil,
@@ -154,10 +152,7 @@ const UserAgentCard = memo<UserAgentCardProps>(
{ skipNull: true },
);
- const isPublished = status === 'published';
- // Agents under review can't be self-managed — publishing is approval-gated and
- // the market rejects manual publish with `forbidden`. Show a view-only card
- // (no owner action menu) until the agent has been validated.
+ // Under-review agents stay view-only until the agent has been validated.
const isUnderReview = isValidated === false;
const handleViewDetail = useCallback(() => {
@@ -215,7 +210,7 @@ const UserAgentCard = memo<UserAgentCardProps>(
}, [canCreate, canEdit, identifier, navigate, createAgent, refreshAgentList, message, t]);
const handleStatusAction = useCallback(
- (action: 'publish' | 'unpublish' | 'deprecate') => {
+ (action: 'deprecate') => {
if (!canEdit) return;
onStatusChange?.(identifier, action);
},
@@ -240,15 +235,6 @@ const UserAgentCard = memo<UserAgentCardProps>(
{
type: 'divider' as const,
},
- {
- disabled: !canEdit,
- icon: <Icon icon={isPublished ? EyeOff : Eye} />,
- key: 'togglePublish',
- label: isPublished
- ? t('setting:myAgents.actions.unpublish')
- : t('setting:myAgents.actions.publish'),
- onClick: () => handleStatusAction(isPublished ? 'unpublish' : 'publish'),
- },
{
danger: true,
disabled: !canEdit,
diff --git a/src/routes/(main)/community/(detail)/user/features/UserGroupCard.tsx b/src/routes/(main)/community/(detail)/user/features/UserGroupCard.tsx
index 5c39d5e4b75..a2c8d4df833 100644
--- a/src/routes/(main)/community/(detail)/user/features/UserGroupCard.tsx
+++ b/src/routes/(main)/community/(detail)/user/features/UserGroupCard.tsx
@@ -18,8 +18,6 @@ import {
AlertTriangle,
ClockIcon,
DownloadIcon,
- Eye,
- EyeOff,
GitForkIcon,
MoreVerticalIcon,
Pencil,
@@ -138,9 +136,7 @@ const UserGroupCard = memo<UserGroupCardProps>(
{ skipNull: true },
);
- const isPublished = status === 'published';
- // Under-review groups can't be self-managed (publish is approval-gated and the
- // market rejects it with `forbidden`), so owners get a view-only card.
+ // Under-review groups stay view-only until the group has been validated.
const isUnderReview = isValidated === false;
const handleCardClick = useCallback(() => {
@@ -152,7 +148,7 @@ const UserGroupCard = memo<UserGroupCardProps>(
}, [identifier, navigate]);
const handleStatusAction = useCallback(
- (action: 'publish' | 'unpublish' | 'deprecate') => {
+ (action: 'deprecate') => {
onStatusChange?.(identifier, action, 'group');
},
[identifier, onStatusChange],
@@ -169,14 +165,6 @@ const UserGroupCard = memo<UserGroupCardProps>(
{
type: 'divider' as const,
},
- {
- icon: <Icon icon={isPublished ? EyeOff : Eye} />,
- key: 'togglePublish',
- label: isPublished
- ? t('setting:myAgents.actions.unpublish')
- : t('setting:myAgents.actions.publish'),
- onClick: () => handleStatusAction(isPublished ? 'unpublish' : 'publish'),
- },
{
danger: true,
icon: <Icon icon={AlertTriangle} />,
diff --git a/src/routes/(main)/community/(detail)/user/features/useUserDetail.ts b/src/routes/(main)/community/(detail)/user/features/useUserDetail.ts
index 397e4dd23f0..db55a50be60 100644
--- a/src/routes/(main)/community/(detail)/user/features/useUserDetail.ts
+++ b/src/routes/(main)/community/(detail)/user/features/useUserDetail.ts
@@ -9,7 +9,7 @@ import { useMarketAuth } from '@/layout/AuthProvider/MarketAuth';
import { marketApiService } from '@/services/marketApi';
import { serverConfigSelectors, useServerConfigStore } from '@/store/serverConfig';
-export type AgentStatusAction = 'publish' | 'unpublish' | 'deprecate';
+export type AgentStatusAction = 'deprecate';
export type EntityType = 'agent' | 'group';
interface UseUserDetailOptions {
@@ -36,45 +36,14 @@ export const useUserDetail = ({ onMutate }: UseUserDetailOptions = {}) => {
const successText = t(`myAgents.actions.${action}Success` as any);
const errorText = t(`myAgents.actions.${action}Error` as any);
- async function executeStatusChange(
- identifier: string,
- action: AgentStatusAction,
- type: EntityType,
- ) {
+ async function executeStatusChange(identifier: string, type: EntityType) {
try {
message.loading({ content: loadingText, key: messageKey });
- marketApiService.setAccessToken(session!.accessToken);
if (type === 'group') {
- switch (action) {
- case 'publish': {
- await marketApiService.publishAgentGroup(identifier);
- break;
- }
- case 'unpublish': {
- await marketApiService.unpublishAgentGroup(identifier);
- break;
- }
- case 'deprecate': {
- await marketApiService.deprecateAgentGroup(identifier);
- break;
- }
- }
+ await marketApiService.deprecateAgentGroup(identifier);
} else {
- switch (action) {
- case 'publish': {
- await marketApiService.publishAgent(identifier);
- break;
- }
- case 'unpublish': {
- await marketApiService.unpublishAgent(identifier);
- break;
- }
- case 'deprecate': {
- await marketApiService.deprecateAgent(identifier);
- break;
- }
- }
+ await marketApiService.deprecateAgent(identifier);
}
message.success({ content: successText, key: messageKey });
@@ -88,21 +57,16 @@ export const useUserDetail = ({ onMutate }: UseUserDetailOptions = {}) => {
}
}
- if (action === 'deprecate') {
- confirmModal({
- cancelText: t('myAgents.actions.cancel'),
- content: t('myAgents.actions.deprecateConfirmContent'),
- okButtonProps: { danger: true },
- okText: t('myAgents.actions.confirmDeprecate'),
- onOk: async () => {
- await executeStatusChange(identifier, action, type);
- },
- title: t('myAgents.actions.deprecateConfirmTitle'),
- });
- return;
- }
-
- await executeStatusChange(identifier, action, type);
+ confirmModal({
+ cancelText: t('myAgents.actions.cancel'),
+ content: t('myAgents.actions.deprecateConfirmContent'),
+ okButtonProps: { danger: true },
+ okText: t('myAgents.actions.confirmDeprecate'),
+ onOk: async () => {
+ await executeStatusChange(identifier, type);
+ },
+ title: t('myAgents.actions.deprecateConfirmTitle'),
+ });
},
[enableMarketTrustedClient, session?.accessToken, message, t, onMutate],
);
diff --git a/src/routes/(main)/group/profile/features/GroupProfile/index.tsx b/src/routes/(main)/group/profile/features/GroupProfile/index.tsx
index 6f42f5775fc..ed74fb09290 100644
--- a/src/routes/(main)/group/profile/features/GroupProfile/index.tsx
+++ b/src/routes/(main)/group/profile/features/GroupProfile/index.tsx
@@ -20,7 +20,6 @@ import { useGroupProfileStore } from '@/store/groupProfile';
import AgentSettings from '../AgentSettings';
import AutoSaveHint from '../Header/AutoSaveHint';
-import GroupPublishButton from '../Header/GroupPublishButton';
import GroupForkTag from './GroupForkTag';
import GroupHeader from './GroupHeader';
import GroupStatusTag from './GroupStatusTag';
@@ -148,7 +147,6 @@ const GroupProfile = memo(() => {
>
{t('startConversation')}
</Button>
- <GroupPublishButton />
{!!transferMenuItems?.length && (
<DropdownMenu items={transferMenuItems}>
<ActionIcon
diff --git a/src/routes/(main)/group/profile/features/Header/AgentPublishButton/PublishButton.tsx b/src/routes/(main)/group/profile/features/Header/AgentPublishButton/PublishButton.tsx
deleted file mode 100644
index 792159cbc6d..00000000000
--- a/src/routes/(main)/group/profile/features/Header/AgentPublishButton/PublishButton.tsx
+++ /dev/null
@@ -1,151 +0,0 @@
-import { ActionIcon } from '@lobehub/ui';
-import { ShapesUploadIcon } from '@lobehub/ui/icons';
-import { memo, useCallback, useMemo } from 'react';
-import { useTranslation } from 'react-i18next';
-
-import { message } from '@/components/AntdStaticMethods';
-import { HEADER_ICON_SIZE } from '@/const/layoutTokens';
-import { checkOwnership } from '@/hooks/useAgentOwnershipCheck';
-import { usePermission } from '@/hooks/usePermission';
-import { useMarketAuth } from '@/layout/AuthProvider/MarketAuth';
-import { resolveMarketAuthError } from '@/layout/AuthProvider/MarketAuth/errors';
-import { useServerConfigStore } from '@/store/serverConfig';
-
-import { type MarketPublishAction } from './types';
-import { useMarketPublish } from './useMarketPublish';
-
-interface MarketPublishButtonProps {
- action: MarketPublishAction;
- marketIdentifier?: string;
- onPublishSuccess?: (identifier: string) => void;
-}
-
-const PublishButton = memo<MarketPublishButtonProps>(
- ({ action, marketIdentifier, onPublishSuccess }) => {
- const { t } = useTranslation(['setting', 'marketAuth']);
- const { allowed: canEdit } = usePermission('edit_own_content');
-
- const mobile = useServerConfigStore((s) => s.isMobile);
-
- const { isAuthenticated, isLoading, session, signIn } = useMarketAuth();
- const { isPublishing, publish } = useMarketPublish({
- action,
- onSuccess: onPublishSuccess,
- });
-
- const buttonConfig = useMemo(() => {
- if (action === 'upload') {
- return {
- authSuccessMessage: t('messages.success.upload', { ns: 'marketAuth' }),
- authenticated: t('marketPublish.upload.tooltip'),
- unauthenticated: t('marketPublish.upload.tooltip'),
- } as const;
- }
-
- const submitText = t('submitAgentModal.tooltips');
-
- return {
- authSuccessMessage: t('messages.success.submit', { ns: 'marketAuth' }),
- authenticated: submitText,
- unauthenticated: t('marketPublish.submit.tooltip'),
- } as const;
- }, [action, t]);
-
- const handleButtonClick = useCallback(async () => {
- if (!isAuthenticated) {
- try {
- message.loading({
- content: t('messages.loading', { ns: 'marketAuth' }),
- key: 'market-auth',
- });
- const accountId = await signIn('publish');
- message.success({ content: buttonConfig.authSuccessMessage, key: 'market-auth' });
-
- // Check ownership after authentication if marketIdentifier exists
- if (marketIdentifier && accountId !== null) {
- let accessToken = session?.accessToken;
-
- if (!accessToken && typeof window !== 'undefined') {
- const storedSession = sessionStorage.getItem('market_auth_session');
- if (storedSession) {
- try {
- const parsed = JSON.parse(storedSession) as { accessToken?: string };
- accessToken = parsed.accessToken;
- } catch (parseError) {
- console.error(
- '[MarketPublishButton] Failed to parse stored session:',
- parseError,
- );
- }
- }
- }
-
- if (accessToken) {
- try {
- const isOwner = await checkOwnership({
- accessToken,
- accountId,
- marketIdentifier,
- skipCache: true,
- });
-
- // If user is not the owner and trying to upload, just return
- // The parent component should handle the action switch
- if (!isOwner && action === 'upload') {
- return;
- }
- } catch (ownershipError) {
- console.error('[MarketPublishButton] Failed to confirm ownership:', ownershipError);
- }
- }
- }
-
- // After authentication, proceed with publish
- await publish();
- } catch (error) {
- console.error(`[MarketPublishButton][${action}] Authorization failed:`, error);
- const normalizedError = resolveMarketAuthError(error);
- message.error({
- content: t(`errors.${normalizedError.code}`, { ns: 'marketAuth' }),
- key: 'market-auth',
- });
- }
- return;
- }
-
- // User is authenticated, directly publish
- await publish();
- }, [
- action,
- buttonConfig.authSuccessMessage,
- isAuthenticated,
- marketIdentifier,
- publish,
- session?.accessToken,
- signIn,
- t,
- ]);
-
- const buttonTitle = isAuthenticated ? buttonConfig.authenticated : buttonConfig.unauthenticated;
- const loading = isLoading || isPublishing;
-
- return (
- <ActionIcon
- disabled={!canEdit}
- icon={ShapesUploadIcon}
- loading={loading}
- size={HEADER_ICON_SIZE(mobile)}
- title={buttonTitle}
- onClick={() => {
- if (!canEdit) return;
-
- handleButtonClick();
- }}
- />
- );
- },
-);
-
-PublishButton.displayName = 'MarketPublishButton';
-
-export default PublishButton;
diff --git a/src/routes/(main)/group/profile/features/Header/AgentPublishButton/PublishResultModal.tsx b/src/routes/(main)/group/profile/features/Header/AgentPublishButton/PublishResultModal.tsx
deleted file mode 100644
index 7ca68bf324b..00000000000
--- a/src/routes/(main)/group/profile/features/Header/AgentPublishButton/PublishResultModal.tsx
+++ /dev/null
@@ -1,61 +0,0 @@
-'use client';
-
-import { FluentEmoji, Modal, Text } from '@lobehub/ui';
-import { Result } from 'antd';
-import { memo } from 'react';
-import { useTranslation } from 'react-i18next';
-
-import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';
-
-interface PublishResultModalProps {
- identifier?: string;
- onCancel: () => void;
- open: boolean;
-}
-
-const PublishResultModal = memo<PublishResultModalProps>(({ identifier, onCancel, open }) => {
- const navigate = useWorkspaceAwareNavigate();
- const { t } = useTranslation('setting');
- const { t: tCommon } = useTranslation('common');
-
- const handleGoToMarket = () => {
- if (identifier) {
- navigate(`/community/group_agent/${identifier}`);
- }
- onCancel();
- };
-
- return (
- <Modal
- centered
- cancelText={tCommon('cancel')}
- okText={t('marketPublish.resultModal.view')}
- open={open}
- title={null}
- width={440}
- onCancel={onCancel}
- onOk={handleGoToMarket}
- >
- <Result
- icon={<FluentEmoji emoji={'🎉'} size={96} type={'anim'} />}
- style={{
- paddingBottom: 32,
- paddingTop: 48,
- width: '100%',
- }}
- subTitle={
- <Text fontSize={14} type={'secondary'}>
- {t('marketPublish.resultModal.message')}
- </Text>
- }
- title={
- <Text fontSize={28} weight={'bold'}>
- {t('marketPublish.resultModal.title')}
- </Text>
- }
- />
- </Modal>
- );
-});
-
-export default PublishResultModal;
diff --git a/src/routes/(main)/group/profile/features/Header/AgentPublishButton/index.tsx b/src/routes/(main)/group/profile/features/Header/AgentPublishButton/index.tsx
deleted file mode 100644
index 4e1e8f2ef64..00000000000
--- a/src/routes/(main)/group/profile/features/Header/AgentPublishButton/index.tsx
+++ /dev/null
@@ -1,80 +0,0 @@
-import { ActionIcon } from '@lobehub/ui';
-import isEqual from 'fast-deep-equal';
-import { Loader2 } from 'lucide-react';
-import { memo, useCallback, useMemo, useState } from 'react';
-import { useTranslation } from 'react-i18next';
-
-import { useAgentOwnershipCheck } from '@/hooks/useAgentOwnershipCheck';
-import { useAgentStore } from '@/store/agent';
-import { agentSelectors } from '@/store/agent/selectors';
-
-import PublishButton from './PublishButton';
-import PublishResultModal from './PublishResultModal';
-
-const AgentPublishButton = memo(() => {
- const { t } = useTranslation('setting');
- const meta = useAgentStore(agentSelectors.currentAgentMeta, isEqual);
- const { isOwnAgent } = useAgentOwnershipCheck(meta?.marketIdentifier);
-
- const [showResultModal, setShowResultModal] = useState(false);
- const [publishedIdentifier, setPublishedIdentifier] = useState<string>();
-
- const handlePublishSuccess = useCallback((identifier: string) => {
- setPublishedIdentifier(identifier);
- setShowResultModal(true);
- }, []);
-
- const buttonType = useMemo(() => {
- if (!meta?.marketIdentifier) {
- return 'submit';
- }
- if (isOwnAgent === null) {
- return 'loading';
- }
- if (isOwnAgent === true) {
- return 'upload';
- }
- return 'submit';
- }, [meta?.marketIdentifier, isOwnAgent]);
-
- const content = useMemo(() => {
- switch (buttonType) {
- case 'upload': {
- return (
- <PublishButton
- action="upload"
- marketIdentifier={meta?.marketIdentifier}
- onPublishSuccess={handlePublishSuccess}
- />
- );
- }
-
- case 'submit': {
- return (
- <PublishButton
- action="submit"
- marketIdentifier={meta?.marketIdentifier}
- onPublishSuccess={handlePublishSuccess}
- />
- );
- }
-
- default: {
- return <ActionIcon disabled loading icon={Loader2} title={t('checkingPermissions')} />;
- }
- }
- }, [buttonType, meta?.marketIdentifier]);
-
- return (
- <>
- {content}
- <PublishResultModal
- identifier={publishedIdentifier}
- open={showResultModal}
- onCancel={() => setShowResultModal(false)}
- />
- </>
- );
-});
-
-export default AgentPublishButton;
diff --git a/src/routes/(main)/group/profile/features/Header/AgentPublishButton/types.ts b/src/routes/(main)/group/profile/features/Header/AgentPublishButton/types.ts
deleted file mode 100644
index f1378b670cf..00000000000
--- a/src/routes/(main)/group/profile/features/Header/AgentPublishButton/types.ts
+++ /dev/null
@@ -1 +0,0 @@
-export type MarketPublishAction = 'submit' | 'upload';
diff --git a/src/routes/(main)/group/profile/features/Header/AgentPublishButton/useMarketPublish.ts b/src/routes/(main)/group/profile/features/Header/AgentPublishButton/useMarketPublish.ts
deleted file mode 100644
index 0229220197e..00000000000
--- a/src/routes/(main)/group/profile/features/Header/AgentPublishButton/useMarketPublish.ts
+++ /dev/null
@@ -1,197 +0,0 @@
-import isEqual from 'fast-deep-equal';
-import { useCallback, useState } from 'react';
-import { useTranslation } from 'react-i18next';
-
-import { useHasActiveWorkspace } from '@/business/client/hooks/useHasActiveWorkspace';
-import { message } from '@/components/AntdStaticMethods';
-import { useTokenCount } from '@/hooks/useTokenCount';
-import { useMarketAuth } from '@/layout/AuthProvider/MarketAuth';
-import { lambdaClient } from '@/libs/trpc/client';
-import { marketApiService } from '@/services/marketApi';
-import { useAgentStore } from '@/store/agent';
-import { agentChatConfigSelectors, agentSelectors } from '@/store/agent/selectors';
-import { useGlobalStore } from '@/store/global';
-import { globalGeneralSelectors } from '@/store/global/selectors';
-
-import { type MarketPublishAction } from './types';
-import { generateDefaultChangelog, generateMarketIdentifier } from './utils';
-
-interface UseMarketPublishOptions {
- action: MarketPublishAction;
- onSuccess?: (identifier: string) => void;
-}
-
-export const useMarketPublish = ({ action, onSuccess }: UseMarketPublishOptions) => {
- const { t } = useTranslation('setting');
- const [isPublishing, setIsPublishing] = useState(false);
- const { isAuthenticated, session } = useMarketAuth();
-
- // Agent data from store
- const meta = useAgentStore(agentSelectors.currentAgentMeta, isEqual);
- const updateAgentMeta = useAgentStore((s) => s.updateAgentMeta);
- const systemRole = useAgentStore(agentSelectors.currentAgentSystemRole);
- const config = useAgentStore(agentSelectors.currentAgentConfig, isEqual);
- const editorData = config?.editorData;
- const language = useGlobalStore(globalGeneralSelectors.currentLanguage);
- const agentConfig = useAgentStore(agentSelectors.currentAgentConfig);
- const chatConfig = useAgentStore(agentChatConfigSelectors.currentChatConfig);
- const plugins = useAgentStore(agentSelectors.currentAgentPlugins);
- const model = useAgentStore(agentSelectors.currentAgentModel);
- const provider = useAgentStore(agentSelectors.currentAgentModelProvider);
- const tokenUsage = useTokenCount(systemRole);
- const hasActiveWorkspace = useHasActiveWorkspace();
-
- const isSubmit = action === 'submit';
-
- const publish = useCallback(async () => {
- if (!isAuthenticated || !session?.accessToken) {
- return { success: false };
- }
-
- const messageKey = isSubmit ? 'submit' : 'upload-version';
- const loadingMessage = isSubmit
- ? t('marketPublish.modal.loading.submit')
- : t('marketPublish.modal.loading.upload');
-
- let identifier = meta?.marketIdentifier;
- const changelog = generateDefaultChangelog();
-
- try {
- setIsPublishing(true);
- message.loading({ content: loadingMessage, key: messageKey });
- marketApiService.setAccessToken(session.accessToken);
- const actAs = hasActiveWorkspace
- ? (await lambdaClient.workspace.ensureMarketOrganization.mutate()).marketAccountId
- : undefined;
-
- if (isSubmit) {
- identifier = generateMarketIdentifier();
-
- try {
- await marketApiService.getAgentDetail(identifier);
- } catch {
- const createPayload: Record<string, unknown> = {
- actAs,
- identifier,
- name: meta?.title || '',
- };
- await marketApiService.createAgent(createPayload as any);
- }
- } else if (!identifier) {
- message.error({
- content: t('marketPublish.modal.messages.missingIdentifier'),
- key: messageKey,
- });
- return { success: false };
- }
-
- const versionPayload = {
- actAs,
- avatar: meta?.avatar,
- changelog,
- config: {
- chatConfig: {
- enableHistoryCount: chatConfig?.enableHistoryCount,
- historyCount: chatConfig?.historyCount,
- maxTokens: agentConfig?.params?.max_tokens,
- searchMode: chatConfig?.searchMode,
- temperature: agentConfig?.params?.temperature,
- topP: agentConfig?.params?.top_p,
- },
- description: meta?.description,
- locale: language,
- model: {
- model,
- parameters: agentConfig?.params,
- provider,
- },
- plugins:
- plugins?.map((plugin) => {
- if (typeof plugin === 'string') {
- return plugin;
- } else {
- return null;
- }
- }) || [],
- systemRole,
- },
- description: meta?.description || '',
- editorData,
- identifier,
- name: meta?.title || '',
- tags: meta?.tags,
- tokenUsage,
- };
-
- try {
- await marketApiService.createAgentVersion(versionPayload);
- } catch (versionError) {
- const errorMessage =
- versionError instanceof Error
- ? versionError.message
- : t('unknownError', { ns: 'common' });
- message.error({
- content: t('marketPublish.modal.messages.createVersionFailed', {
- message: errorMessage,
- }),
- key: messageKey,
- });
- return { success: false };
- }
-
- if (isSubmit) {
- updateAgentMeta({ marketIdentifier: identifier });
- }
-
- message.success({
- content: t('submitAgentModal.success'),
- key: messageKey,
- });
-
- onSuccess?.(identifier!);
- return { identifier, success: true };
- } catch (error) {
- console.error('Market publish failed:', error);
- const errorMessage =
- error instanceof Error ? error.message : t('unknownError', { ns: 'common' });
- message.error({
- content: t('marketPublish.modal.messages.publishFailed', {
- message: errorMessage,
- }),
- key: messageKey,
- });
- return { success: false };
- } finally {
- setIsPublishing(false);
- }
- }, [
- agentConfig?.params,
- chatConfig?.enableHistoryCount,
- chatConfig?.historyCount,
- chatConfig?.searchMode,
- editorData,
- hasActiveWorkspace,
- isAuthenticated,
- isSubmit,
- language,
- meta?.avatar,
- meta?.description,
- meta?.marketIdentifier,
- meta?.tags,
- meta?.title,
- model,
- onSuccess,
- plugins,
- provider,
- session?.accessToken,
- systemRole,
- tokenUsage,
- t,
- updateAgentMeta,
- ]);
-
- return {
- isPublishing,
- publish,
- };
-};
diff --git a/src/routes/(main)/group/profile/features/Header/AgentPublishButton/utils.ts b/src/routes/(main)/group/profile/features/Header/AgentPublishButton/utils.ts
deleted file mode 100644
index 877a3a75479..00000000000
--- a/src/routes/(main)/group/profile/features/Header/AgentPublishButton/utils.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { customAlphabet } from 'nanoid/non-secure';
-
-/**
- * Generate a market identifier (8-character lowercase alphanumeric string)
- * Format: [a-z0-9]{8}
- * @returns A unique 8-character market identifier
- */
-export const generateMarketIdentifier = () => {
- const alphabet = '0123456789abcdefghijklmnopqrstuvwxyz';
- const generate = customAlphabet(alphabet, 8);
- return generate();
-};
-
-/**
- * Generate a default changelog based on current timestamp
- * @returns A timestamp-based changelog string
- */
-export const generateDefaultChangelog = () => {
- const now = new Date();
- const formattedDate = now.toISOString().split('T')[0];
- return `Release ${formattedDate}`;
-};
diff --git a/src/routes/(main)/group/profile/features/Header/GroupPublishButton/GroupForkConfirmModal.tsx b/src/routes/(main)/group/profile/features/Header/GroupPublishButton/GroupForkConfirmModal.tsx
deleted file mode 100644
index 54e3ad11df8..00000000000
--- a/src/routes/(main)/group/profile/features/Header/GroupPublishButton/GroupForkConfirmModal.tsx
+++ /dev/null
@@ -1,60 +0,0 @@
-'use client';
-
-import { Avatar, Flexbox, Modal } from '@lobehub/ui';
-import { memo } from 'react';
-import { useTranslation } from 'react-i18next';
-
-import { type OriginalGroupInfo } from './types';
-
-interface GroupForkConfirmModalProps {
- loading?: boolean;
- onCancel: () => void;
- onConfirm: () => void;
- open: boolean;
- originalGroup: OriginalGroupInfo | null;
-}
-
-const GroupForkConfirmModal = memo<GroupForkConfirmModalProps>(
- ({ open, onCancel, onConfirm, originalGroup, loading }) => {
- const { t } = useTranslation('setting');
-
- if (!originalGroup) return null;
-
- const authorName = originalGroup.author?.name || originalGroup.author?.userName || 'Unknown';
-
- return (
- <Modal
- centered
- closable
- cancelText={t('cancel', { ns: 'common' })}
- confirmLoading={loading}
- okText={t('marketPublish.forkConfirm.confirmGroup')}
- open={open}
- title={t('marketPublish.forkConfirm.titleGroup')}
- width={480}
- onCancel={onCancel}
- onOk={onConfirm}
- >
- <Flexbox gap={16} style={{ marginTop: 16 }}>
- <Flexbox horizontal align="center" gap={12}>
- <Avatar avatar={originalGroup.avatar} size={48} style={{ flex: 'none' }} />
- <Flexbox gap={4}>
- <div style={{ fontWeight: 500 }}>{originalGroup.name}</div>
- <div style={{ fontSize: 12, opacity: 0.6 }}>
- {t('marketPublish.forkConfirm.by', { author: authorName })}
- </div>
- </Flexbox>
- </Flexbox>
-
- <p style={{ lineHeight: 1.6, margin: 0 }}>
- {t('marketPublish.forkConfirm.descriptionGroup')}
- </p>
- </Flexbox>
- </Modal>
- );
- },
-);
-
-GroupForkConfirmModal.displayName = 'GroupForkConfirmModal';
-
-export default GroupForkConfirmModal;
diff --git a/src/routes/(main)/group/profile/features/Header/GroupPublishButton/GroupPublishResultModal.tsx b/src/routes/(main)/group/profile/features/Header/GroupPublishButton/GroupPublishResultModal.tsx
deleted file mode 100644
index b08725218cf..00000000000
--- a/src/routes/(main)/group/profile/features/Header/GroupPublishButton/GroupPublishResultModal.tsx
+++ /dev/null
@@ -1,63 +0,0 @@
-'use client';
-
-import { FluentEmoji, Modal, Text } from '@lobehub/ui';
-import { Result } from 'antd';
-import { memo } from 'react';
-import { useTranslation } from 'react-i18next';
-
-import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';
-
-interface GroupPublishResultModalProps {
- identifier?: string;
- onCancel: () => void;
- open: boolean;
-}
-
-const GroupPublishResultModal = memo<GroupPublishResultModalProps>(
- ({ identifier, onCancel, open }) => {
- const navigate = useWorkspaceAwareNavigate();
- const { t } = useTranslation('setting');
- const { t: tCommon } = useTranslation('common');
-
- const handleGoToMarket = () => {
- if (identifier) {
- navigate(`/community/group_agent/${identifier}`);
- }
- onCancel();
- };
-
- return (
- <Modal
- centered
- cancelText={tCommon('cancel')}
- okText={t('marketPublish.resultModal.view')}
- open={open}
- title={null}
- width={440}
- onCancel={onCancel}
- onOk={handleGoToMarket}
- >
- <Result
- icon={<FluentEmoji emoji={'🎉'} size={96} type={'anim'} />}
- style={{
- paddingBottom: 32,
- paddingTop: 48,
- width: '100%',
- }}
- subTitle={
- <Text fontSize={14} type={'secondary'}>
- {t('marketPublish.resultModal.messageGroup')}
- </Text>
- }
- title={
- <Text fontSize={28} weight={'bold'}>
- {t('marketPublish.resultModal.title')}
- </Text>
- }
- />
- </Modal>
- );
- },
-);
-
-export default GroupPublishResultModal;
diff --git a/src/routes/(main)/group/profile/features/Header/GroupPublishButton/PublishButton.tsx b/src/routes/(main)/group/profile/features/Header/GroupPublishButton/PublishButton.tsx
deleted file mode 100644
index 87b151736f0..00000000000
--- a/src/routes/(main)/group/profile/features/Header/GroupPublishButton/PublishButton.tsx
+++ /dev/null
@@ -1,199 +0,0 @@
-import { Button } from '@lobehub/ui';
-import { ShapesUploadIcon } from '@lobehub/ui/icons';
-import { Popconfirm } from 'antd';
-import isEqual from 'fast-deep-equal';
-import { memo, useCallback, useMemo, useState } from 'react';
-import { useTranslation } from 'react-i18next';
-
-import { message } from '@/components/AntdStaticMethods';
-import { useCommunityPublishGuard } from '@/hooks/useCommunityPublishGuard';
-import { usePermission } from '@/hooks/usePermission';
-import { useMarketAuth } from '@/layout/AuthProvider/MarketAuth';
-import { resolveMarketAuthError } from '@/layout/AuthProvider/MarketAuth/errors';
-import { useAgentGroupStore } from '@/store/agentGroup';
-import { agentGroupSelectors } from '@/store/agentGroup/selectors';
-
-import { useGroupVersionReviewStatus } from '../../GroupProfile/GroupVersionReviewTag';
-import GroupForkConfirmModal from './GroupForkConfirmModal';
-import { type MarketPublishAction, type OriginalGroupInfo } from './types';
-import { useMarketGroupPublish } from './useMarketGroupPublish';
-
-interface GroupPublishButtonProps {
- action: MarketPublishAction;
- onPublishSuccess?: (identifier: string) => void;
-}
-
-const PublishButton = memo<GroupPublishButtonProps>(({ action, onPublishSuccess }) => {
- const { t } = useTranslation(['setting', 'marketAuth']);
- const { allowed: canEdit } = usePermission('edit_own_content');
-
- const ensureCommunityPublishAllowed = useCommunityPublishGuard();
-
- const { isAuthenticated, isLoading, signIn } = useMarketAuth();
- const { checkOwnership, isCheckingOwnership, isPublishing, publish } = useMarketGroupPublish({
- action,
- onSuccess: onPublishSuccess,
- });
-
- // Check if the latest version is under review
- const { isUnderReview } = useGroupVersionReviewStatus();
-
- // Group data for validation
- const currentGroupMeta = useAgentGroupStore(agentGroupSelectors.currentGroupMeta, isEqual);
- const currentGroup = useAgentGroupStore(agentGroupSelectors.currentGroup);
-
- // Fork confirmation modal state
- const [showForkModal, setShowForkModal] = useState(false);
- const [originalGroupInfo, setOriginalGroupInfo] = useState<OriginalGroupInfo | null>(null);
-
- // Publish confirmation popconfirm state
- const [confirmOpened, setConfirmOpened] = useState(false);
-
- const buttonConfig = useMemo(() => {
- if (action === 'upload') {
- return {
- authenticated: t('marketPublish.uploadGroup.tooltip'),
- unauthenticated: t('marketPublish.uploadGroup.tooltip'),
- } as const;
- }
-
- const submitText = t('submitGroupModal.tooltips');
-
- return {
- authenticated: submitText,
- unauthenticated: t('marketPublish.submitGroup.tooltip'),
- } as const;
- }, [action, t]);
-
- const doPublish = useCallback(async () => {
- // Check ownership before publishing
- const { needsForkConfirm, originalGroup } = await checkOwnership();
-
- if (needsForkConfirm && originalGroup) {
- // Show fork confirmation modal
- setOriginalGroupInfo(originalGroup);
- setShowForkModal(true);
- return;
- }
-
- // No confirmation needed, proceed with publish
- await publish();
- }, [checkOwnership, publish]);
-
- const handleButtonClick = useCallback(() => {
- if (!ensureCommunityPublishAllowed()) return;
-
- // Check if the latest version is under review
- if (isUnderReview) {
- message.warning({
- content: t('marketPublish.validation.underReview', {
- defaultValue:
- 'Your new version is currently under review. Please wait for the review to complete before publishing a new version.',
- }),
- });
- return;
- }
-
- // Validate name and systemRole (stored in content)
- if (!currentGroupMeta?.title || currentGroupMeta.title.trim() === '') {
- message.error({ content: t('marketPublish.validation.emptyName') });
- return;
- }
-
- if (!currentGroup?.content || currentGroup.content.trim() === '') {
- message.error({ content: t('marketPublish.validation.emptySystemRole') });
- return;
- }
-
- // Open popconfirm for user confirmation
- setConfirmOpened(true);
- }, [
- currentGroupMeta?.title,
- currentGroup?.content,
- ensureCommunityPublishAllowed,
- isUnderReview,
- t,
- ]);
-
- const handleConfirmPublish = useCallback(async () => {
- setConfirmOpened(false);
-
- if (!isAuthenticated) {
- try {
- await signIn('publish');
- // After authentication, proceed with ownership check and publish
- await doPublish();
- } catch (error) {
- console.error(`[GroupPublishButton][${action}] Authorization failed:`, error);
- const normalizedError = resolveMarketAuthError(error);
- message.error({
- content: t(`errors.${normalizedError.code}`, { ns: 'marketAuth' }),
- key: 'market-auth',
- });
- }
- return;
- }
-
- // User is authenticated, check ownership and publish
- await doPublish();
- }, [action, doPublish, isAuthenticated, signIn, t]);
-
- const handleForkConfirm = useCallback(async () => {
- setShowForkModal(false);
- setOriginalGroupInfo(null);
- // User confirmed, proceed with publish
- await publish();
- }, [publish]);
-
- const handleForkCancel = useCallback(() => {
- setShowForkModal(false);
- setOriginalGroupInfo(null);
- }, []);
-
- const buttonTitle = isAuthenticated ? buttonConfig.authenticated : buttonConfig.unauthenticated;
- const loading = isLoading || isCheckingOwnership || isPublishing;
-
- return (
- <>
- <Popconfirm
- arrow={false}
- okButtonProps={{ type: 'primary' }}
- open={confirmOpened}
- placement="bottomRight"
- title={t('marketPublish.validation.confirmPublish')}
- onCancel={() => setConfirmOpened(false)}
- onConfirm={handleConfirmPublish}
- onOpenChange={(open) => {
- if (!open) {
- setConfirmOpened(false);
- }
- }}
- >
- <Button
- disabled={!canEdit}
- icon={ShapesUploadIcon}
- loading={loading}
- title={buttonTitle}
- onClick={() => {
- if (!canEdit) return;
-
- handleButtonClick();
- }}
- >
- {t('publishToCommunity')}
- </Button>
- </Popconfirm>
- <GroupForkConfirmModal
- loading={isPublishing}
- open={showForkModal}
- originalGroup={originalGroupInfo}
- onCancel={handleForkCancel}
- onConfirm={handleForkConfirm}
- />
- </>
- );
-});
-
-PublishButton.displayName = 'GroupPublishButton';
-
-export default PublishButton;
diff --git a/src/routes/(main)/group/profile/features/Header/GroupPublishButton/index.tsx b/src/routes/(main)/group/profile/features/Header/GroupPublishButton/index.tsx
deleted file mode 100644
index cf5cf24ad0b..00000000000
--- a/src/routes/(main)/group/profile/features/Header/GroupPublishButton/index.tsx
+++ /dev/null
@@ -1,46 +0,0 @@
-import isEqual from 'fast-deep-equal';
-import { memo, useCallback, useState } from 'react';
-
-import { useAgentGroupStore } from '@/store/agentGroup';
-import { agentGroupSelectors } from '@/store/agentGroup/selectors';
-
-import GroupPublishResultModal from './GroupPublishResultModal';
-import PublishButton from './PublishButton';
-
-/**
- * Group Publish Button Component
- *
- * Simplified version - backend handles ownership check automatically.
- * The action type (submit vs upload) is determined by backend based on:
- * 1. Whether the identifier exists
- * 2. Whether the current user is the owner
- */
-const GroupPublishButton = memo(() => {
- const currentGroup = useAgentGroupStore(agentGroupSelectors.currentGroup, isEqual);
-
- const [showResultModal, setShowResultModal] = useState(false);
- const [publishedIdentifier, setPublishedIdentifier] = useState<string>();
-
- const handlePublishSuccess = useCallback((identifier: string) => {
- setPublishedIdentifier(identifier);
- setShowResultModal(true);
- }, []);
-
- // Determine action based on whether we have an existing marketIdentifier
- // Backend will verify ownership and decide to create new or update
- // marketIdentifier is stored at top-level (same as agents)
- const action = currentGroup?.marketIdentifier ? 'upload' : 'submit';
-
- return (
- <>
- <PublishButton action={action} onPublishSuccess={handlePublishSuccess} />
- <GroupPublishResultModal
- identifier={publishedIdentifier}
- open={showResultModal}
- onCancel={() => setShowResultModal(false)}
- />
- </>
- );
-});
-
-export default GroupPublishButton;
diff --git a/src/routes/(main)/group/profile/features/Header/GroupPublishButton/types.ts b/src/routes/(main)/group/profile/features/Header/GroupPublishButton/types.ts
deleted file mode 100644
index 20e92ddfdf0..00000000000
--- a/src/routes/(main)/group/profile/features/Header/GroupPublishButton/types.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-export type MarketPublishAction = 'submit' | 'upload';
-
-export interface OriginalGroupInfo {
- author?: {
- avatar?: string;
- name?: string;
- userName?: string;
- };
- avatar?: string;
- identifier: string;
- name: string;
-}
diff --git a/src/routes/(main)/group/profile/features/Header/GroupPublishButton/useMarketGroupPublish.ts b/src/routes/(main)/group/profile/features/Header/GroupPublishButton/useMarketGroupPublish.ts
deleted file mode 100644
index d74548d02af..00000000000
--- a/src/routes/(main)/group/profile/features/Header/GroupPublishButton/useMarketGroupPublish.ts
+++ /dev/null
@@ -1,240 +0,0 @@
-import isEqual from 'fast-deep-equal';
-import { useCallback, useRef, useState } from 'react';
-import { useTranslation } from 'react-i18next';
-
-import { useHasActiveWorkspace } from '@/business/client/hooks/useHasActiveWorkspace';
-import { message } from '@/components/AntdStaticMethods';
-import { useMarketAuth } from '@/layout/AuthProvider/MarketAuth';
-import { lambdaClient } from '@/libs/trpc/client';
-import { useAgentGroupStore } from '@/store/agentGroup';
-import { agentGroupSelectors } from '@/store/agentGroup/selectors';
-import { useGlobalStore } from '@/store/global';
-import { globalGeneralSelectors } from '@/store/global/selectors';
-
-import { type MarketPublishAction, type OriginalGroupInfo } from './types';
-import { generateDefaultChangelog } from './utils';
-
-interface UseMarketGroupPublishOptions {
- action: MarketPublishAction;
- onSuccess?: (identifier: string) => void;
-}
-
-export interface CheckOwnershipResult {
- needsForkConfirm: boolean;
- originalGroup: OriginalGroupInfo | null;
-}
-
-export const useMarketGroupPublish = ({ action, onSuccess }: UseMarketGroupPublishOptions) => {
- const { t } = useTranslation('setting');
- const [isPublishing, setIsPublishing] = useState(false);
- const [isCheckingOwnership, setIsCheckingOwnership] = useState(false);
- const isPublishingRef = useRef(false);
- const { isAuthenticated } = useMarketAuth();
-
- // Group data from store
- const currentGroup = useAgentGroupStore(agentGroupSelectors.currentGroup);
- const currentGroupMeta = useAgentGroupStore(agentGroupSelectors.currentGroupMeta, isEqual);
- const currentGroupConfig = useAgentGroupStore(agentGroupSelectors.currentGroupConfig, isEqual);
- const currentGroupAgents = useAgentGroupStore(agentGroupSelectors.currentGroupAgents);
- const updateGroupMeta = useAgentGroupStore((s) => s.updateGroupMeta);
- const language = useGlobalStore(globalGeneralSelectors.currentLanguage);
- const hasActiveWorkspace = useHasActiveWorkspace();
-
- const isSubmit = action === 'submit';
-
- /**
- * Check ownership before publishing
- * Returns whether fork confirmation is needed and original group info
- */
- const checkOwnership = useCallback(async (): Promise<CheckOwnershipResult> => {
- // marketIdentifier is stored at top-level (same as agents)
- const identifier = currentGroup?.marketIdentifier;
-
- // No identifier means new group, no need to check
- if (!identifier) {
- return { needsForkConfirm: false, originalGroup: null };
- }
-
- try {
- setIsCheckingOwnership(true);
- let actAs: number | undefined;
- if (hasActiveWorkspace) {
- try {
- const { marketAccountId } =
- await lambdaClient.workspace.ensureMarketOrganization.mutate();
- actAs = marketAccountId;
- } catch (error) {
- console.warn(
- 'Failed to resolve Market organization for workspace ownership check:',
- error,
- );
- }
- }
-
- const result = await lambdaClient.market.agentGroup.checkOwnership.query({
- actAs,
- identifier,
- });
-
- // If group doesn't exist or user is owner, no confirmation needed
- if (!result.exists || result.isOwner) {
- return { needsForkConfirm: false, originalGroup: null };
- }
-
- // User is not owner, need fork confirmation
- return {
- needsForkConfirm: true,
- originalGroup: result.originalGroup as OriginalGroupInfo,
- };
- } catch (error) {
- console.error('[useMarketGroupPublish] Failed to check ownership:', error);
- // On error, proceed without confirmation
- return { needsForkConfirm: false, originalGroup: null };
- } finally {
- setIsCheckingOwnership(false);
- }
- }, [currentGroup, hasActiveWorkspace]);
-
- const publish = useCallback(async () => {
- // Prevent duplicate publishing
- if (isPublishingRef.current) {
- return { success: false };
- }
-
- // Check authentication
- if (!isAuthenticated) {
- return { success: false };
- }
-
- if (!currentGroup) {
- message.error({ content: t('marketPublish.modal.messages.noGroup') });
- return { success: false };
- }
-
- const messageKey = isSubmit ? 'submit-group' : 'upload-group-version';
- const loadingMessage = isSubmit
- ? t('marketPublish.modal.loading.submitGroup')
- : t('marketPublish.modal.loading.uploadGroup');
-
- const changelog = generateDefaultChangelog();
-
- try {
- isPublishingRef.current = true;
- setIsPublishing(true);
- message.loading({ content: loadingMessage, key: messageKey });
- const actAs = hasActiveWorkspace
- ? (await lambdaClient.workspace.ensureMarketOrganization.mutate()).marketAccountId
- : undefined;
-
- // Prepare member agents data
- const memberAgents = currentGroupAgents.map((agent, index) => ({
- // Only include avatar if it's not null/undefined
- ...(agent.avatar ? { avatar: agent.avatar } : {}),
- config: {
- // Include agent configuration
- model: agent.model,
- params: agent.params,
- systemRole: agent.systemRole,
- // Include plugins if they exist
- ...(agent.plugins && agent.plugins.length > 0 ? { plugins: agent.plugins } : {}),
- // Include provider if it exists
- ...(agent.provider ? { provider: agent.provider } : {}),
- // Include chatConfig if it exists
- ...(agent.chatConfig ? { chatConfig: agent.chatConfig } : {}),
- },
- // Market requires at least 1 character for description
- description: agent.description || 'No description provided',
- displayOrder: index,
- identifier: agent.id, // Use local agent ID as identifier
- name: agent.title || 'Untitled Agent',
- role: agent.isSupervisor ? ('supervisor' as const) : ('participant' as const),
- // TODO: Construct proper A2A URL for the agent
- url: `https://api.lobehub.com/a2a/agents/${agent.id}`,
- }));
-
- // Use tRPC publishOrCreate
- const result = await lambdaClient.market.agentGroup.publishOrCreate.mutate({
- actAs,
- // Only include avatar if it's not null/undefined
- ...(currentGroupMeta.avatar ? { avatar: currentGroupMeta.avatar } : {}),
- // Only include backgroundColor if it's not null/undefined
- ...(currentGroup.backgroundColor ? { backgroundColor: currentGroup.backgroundColor } : {}),
- category: 'productivity', // TODO: Allow user to select category
- changelog,
- // Include group-level config (systemPrompt from content, openingMessage, etc.)
- config: {
- // Group systemPrompt is stored in currentGroup.content
- ...(currentGroup.content !== undefined &&
- currentGroup.content !== null && {
- systemPrompt: currentGroup.content,
- }),
- ...(currentGroupConfig.openingMessage !== undefined && {
- openingMessage: currentGroupConfig.openingMessage,
- }),
- ...(currentGroupConfig.openingQuestions !== undefined &&
- currentGroupConfig.openingQuestions.length > 0 && {
- openingQuestions: currentGroupConfig.openingQuestions,
- }),
- ...(currentGroupConfig.allowDM !== undefined && { allowDM: currentGroupConfig.allowDM }),
- ...(currentGroupConfig.revealDM !== undefined && {
- revealDM: currentGroupConfig.revealDM,
- }),
- },
- // Market requires at least 1 character for description
- description: currentGroupMeta.description || 'No description provided',
- // marketIdentifier is stored at top-level (same as agents)
- identifier: currentGroup.marketIdentifier,
- memberAgents,
- name: currentGroupMeta.title || 'Untitled Group',
- visibility: 'public', // TODO: Allow user to select visibility
- });
-
- // Save marketIdentifier at top-level if new group (same as agents)
- if (result.isNewGroup) {
- await updateGroupMeta({
- marketIdentifier: result.identifier,
- });
- }
-
- message.success({
- content: t('submitAgentModal.success'),
- key: messageKey,
- });
-
- onSuccess?.(result.identifier);
- return { identifier: result.identifier, success: true };
- } catch (error) {
- const errorMessage =
- error instanceof Error ? error.message : t('unknownError', { ns: 'common' });
- message.error({
- content: t('marketPublish.modal.messages.publishFailed', {
- message: errorMessage,
- }),
- key: messageKey,
- });
- return { success: false };
- } finally {
- isPublishingRef.current = false;
- setIsPublishing(false);
- }
- }, [
- currentGroup,
- currentGroupAgents,
- currentGroupConfig,
- currentGroupMeta,
- hasActiveWorkspace,
- isAuthenticated,
- isSubmit,
- language,
- onSuccess,
- t,
- updateGroupMeta,
- ]);
-
- return {
- checkOwnership,
- isCheckingOwnership,
- isPublishing,
- publish,
- };
-};
diff --git a/src/routes/(main)/group/profile/features/Header/GroupPublishButton/utils.ts b/src/routes/(main)/group/profile/features/Header/GroupPublishButton/utils.ts
deleted file mode 100644
index 877a3a75479..00000000000
--- a/src/routes/(main)/group/profile/features/Header/GroupPublishButton/utils.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { customAlphabet } from 'nanoid/non-secure';
-
-/**
- * Generate a market identifier (8-character lowercase alphanumeric string)
- * Format: [a-z0-9]{8}
- * @returns A unique 8-character market identifier
- */
-export const generateMarketIdentifier = () => {
- const alphabet = '0123456789abcdefghijklmnopqrstuvwxyz';
- const generate = customAlphabet(alphabet, 8);
- return generate();
-};
-
-/**
- * Generate a default changelog based on current timestamp
- * @returns A timestamp-based changelog string
- */
-export const generateDefaultChangelog = () => {
- const now = new Date();
- const formattedDate = now.toISOString().split('T')[0];
- return `Release ${formattedDate}`;
-};
diff --git a/src/services/_url.ts b/src/services/_url.ts
index 8a33d58aad4..1f049feb1b2 100644
--- a/src/services/_url.ts
+++ b/src/services/_url.ts
@@ -31,48 +31,3 @@ export const MARKET_OIDC_ENDPOINTS = {
// Same as `auth`: used as `redirect_uri` (must be a real web URL under market base).
desktopCallback: '/lobehub-oidc/callback/desktop',
};
-
-export const MARKET_ENDPOINTS = {
- base: '/market',
- // Agent management
- createAgent: '/market/agent/create',
- getAgentDetail: (identifier: string) => `/market/agent/${encodeURIComponent(identifier)}`,
- getOwnAgents: '/market/agent/own',
- createAgentVersion: '/market/agent/versions/create',
- // Agent status management
- publishAgent: (identifier: string) => `/market/agent/${encodeURIComponent(identifier)}/publish`,
- unpublishAgent: (identifier: string) =>
- `/market/agent/${encodeURIComponent(identifier)}/unpublish`,
- deprecateAgent: (identifier: string) =>
- `/market/agent/${encodeURIComponent(identifier)}/deprecate`,
- // User profile
- getUserProfile: (username: string) => `/market/user/${encodeURIComponent(username)}`,
- updateUserProfile: '/market/user/me',
-
- // Social - Follow
- follow: '/market/social/follow',
- unfollow: '/market/social/unfollow',
- followStatus: (userId: number) => `/market/social/follow-status/${userId}`,
- following: (userId: number) => `/market/social/following/${userId}`,
- followers: (userId: number) => `/market/social/followers/${userId}`,
- followCounts: (userId: number) => `/market/social/follow-counts/${userId}`,
-
- // Social - Favorite
- favorite: '/market/social/favorite',
- unfavorite: '/market/social/unfavorite',
- favoriteStatus: (targetType: 'agent' | 'plugin', targetIdOrIdentifier: number | string) =>
- `/market/social/favorite-status/${targetType}/${encodeURIComponent(targetIdOrIdentifier)}`,
- myFavorites: '/market/social/favorites',
- userFavorites: (userId: number) => `/market/social/user-favorites/${userId}`,
- favoriteAgents: (userId: number) => `/market/social/favorite-agents/${userId}`,
- favoritePlugins: (userId: number) => `/market/social/favorite-plugins/${userId}`,
-
- // Social - Like
- like: '/market/social/like',
- unlike: '/market/social/unlike',
- toggleLike: '/market/social/toggle-like',
- likeStatus: (targetType: 'agent' | 'plugin', targetIdOrIdentifier: number | string) =>
- `/market/social/like-status/${targetType}/${encodeURIComponent(targetIdOrIdentifier)}`,
- likedAgents: (userId: number) => `/market/social/liked-agents/${userId}`,
- likedPlugins: (userId: number) => `/market/social/liked-plugins/${userId}`,
-};
diff --git a/src/services/marketApi.ts b/src/services/marketApi.ts
index fc1cb805085..4bdb097cb73 100644
--- a/src/services/marketApi.ts
+++ b/src/services/marketApi.ts
@@ -23,15 +23,6 @@ interface GetOwnAgentsParams {
}
export class MarketApiService {
- /**
- * @deprecated This method is no longer needed as authentication is now handled
- * automatically through tRPC middleware. Keeping for backward compatibility.
- */
-
- setAccessToken(_token: string) {
- // No-op: Authentication is now handled through tRPC authedProcedure middleware
- }
-
// Create new agent
async createAgent(agentData: {
actAs?: number;
@@ -97,16 +88,6 @@ export class MarketApiService {
return lambdaClient.market.agent.createAgentVersion.mutate(versionData);
}
- // Publish agent (make it visible in marketplace)
- async publishAgent(identifier: string): Promise<void> {
- await lambdaClient.market.agent.publishAgent.mutate({ identifier });
- }
-
- // Unpublish agent (hide from marketplace, can be republished)
- async unpublishAgent(identifier: string): Promise<void> {
- await lambdaClient.market.agent.unpublishAgent.mutate({ identifier });
- }
-
// Deprecate agent (permanently hide, cannot be republished)
async deprecateAgent(identifier: string): Promise<void> {
await lambdaClient.market.agent.deprecateAgent.mutate({ identifier });
@@ -157,14 +138,6 @@ export class MarketApiService {
}) as Promise<any>;
}
- async publishAgentGroup(identifier: string): Promise<void> {
- await lambdaClient.market.agentGroup.publishAgentGroup.mutate({ identifier });
- }
-
- async unpublishAgentGroup(identifier: string): Promise<void> {
- await lambdaClient.market.agentGroup.unpublishAgentGroup.mutate({ identifier });
- }
-
async deprecateAgentGroup(identifier: string): Promise<void> {
await lambdaClient.market.agentGroup.deprecateAgentGroup.mutate({ identifier });
}
diff --git a/src/store/agent/selectors/selectors.test.ts b/src/store/agent/selectors/selectors.test.ts
index e83fb435696..142485ed33b 100644
--- a/src/store/agent/selectors/selectors.test.ts
+++ b/src/store/agent/selectors/selectors.test.ts
@@ -388,50 +388,6 @@ describe('agentSelectors', () => {
});
});
- describe('canCurrentAgentPublishToCommunity', () => {
- it('should allow publishing normal agents', () => {
- const state = createState({
- activeAgentId: 'agent-1',
- agentMap: { 'agent-1': { id: 'agent-1' } },
- });
-
- expect(agentSelectors.canCurrentAgentPublishToCommunity(state)).toBe(true);
- });
-
- it('should prevent publishing local heterogeneous agents', () => {
- const state = createState({
- activeAgentId: 'agent-1',
- agentMap: {
- 'agent-1': {
- agencyConfig: {
- heterogeneousProvider: { command: 'codex', type: 'codex' },
- },
- id: 'agent-1',
- },
- },
- });
-
- expect(agentSelectors.canCurrentAgentPublishToCommunity(state)).toBe(false);
- });
-
- it('should prevent publishing platform agents', () => {
- const state = createState({
- activeAgentId: 'agent-1',
- agentMap: {
- 'agent-1': {
- agencyConfig: {
- boundDeviceId: 'device-1',
- heterogeneousProvider: { type: 'openclaw' },
- },
- id: 'agent-1',
- },
- },
- });
-
- expect(agentSelectors.canCurrentAgentPublishToCommunity(state)).toBe(false);
- });
- });
-
describe('currentKnowledgeIds', () => {
it('should return enabled file and knowledge base IDs', () => {
const state = createState({
diff --git a/src/store/agent/selectors/selectors.ts b/src/store/agent/selectors/selectors.ts
index a678af33556..445ec2b8b33 100644
--- a/src/store/agent/selectors/selectors.ts
+++ b/src/store/agent/selectors/selectors.ts
@@ -311,9 +311,6 @@ const isCurrentAgentExternal = (s: AgentStoreState): boolean => !currentAgentDat
const isCurrentAgentHeterogeneous = (s: AgentStoreState): boolean =>
!!currentAgentConfig(s)?.agencyConfig?.heterogeneousProvider;
-const canCurrentAgentPublishToCommunity = (s: AgentStoreState): boolean =>
- !!currentAgentData(s) && !isCurrentAgentHeterogeneous(s);
-
const currentAgentHeterogeneousProviderType = (s: AgentStoreState) =>
currentAgentConfig(s)?.agencyConfig?.heterogeneousProvider?.type;
@@ -324,7 +321,6 @@ const getAgentDocumentsById = (agentId: string) => (s: AgentStoreState) =>
s.agentDocumentsMap[agentId];
export const agentSelectors = {
- canCurrentAgentPublishToCommunity,
currentAgentExecutionTarget,
currentAgentHeterogeneousProviderType,
currentAgentAvatar,