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.

✨ feat(settings): Integrations directory with a GitHub integration page (#19726)

Arvin Xub06fbb5cc14b
diff --git a/locales/en-US/integration.json b/locales/en-US/integration.json
new file mode 100644
index 00000000000..27dfbec5c26
--- /dev/null
+++ b/locales/en-US/integration.json
@@ -0,0 +1,63 @@
+{
+ "github.automation.acceptOnMerge.description": "When a pull request linked to an acceptance is merged, mark the acceptance as accepted and complete its task.",
+ "github.automation.acceptOnMerge.title": "Accept deliveries on merge",
+ "github.automation.description": "What LobeHub does on its own when GitHub reports activity.",
+ "github.automation.title": "Automation",
+ "github.automation.wakeOnCiFailure.description": "When a check fails, notify the agent that opened the pull request with the failing job log. At most three times per pull request.",
+ "github.automation.wakeOnCiFailure.title": "Notify agents on CI failure",
+ "github.automation.wakeOnReview.description": "When a reviewer requests changes or comments, deliver the feedback to the agent that opened the pull request.",
+ "github.automation.wakeOnReview.title": "Notify agents on review feedback",
+ "github.comments.commentOnPrivateRepositories.description": "Post one comment linking the acceptance and the conversation behind the pull request.",
+ "github.comments.commentOnPrivateRepositories.title": "Private repositories",
+ "github.comments.commentOnPublicRepositories.description": "Off by default: a public thread is not the place for links into your workspace.",
+ "github.comments.commentOnPublicRepositories.title": "Public repositories",
+ "github.comments.description": "Leave a comment on pull requests with links back to the LobeHub acceptance and conversation.",
+ "github.comments.title": "Comments in GitHub",
+ "github.connections.allRepositories": "All repositories",
+ "github.connections.connect": "Connect account",
+ "github.connections.connectedOn": "Connected {{date}}",
+ "github.connections.empty": "No account connected yet. Install the LobeHub app on your GitHub account or organization to get started.",
+ "github.connections.enabledBy": "Enabled by {{login}} · {{date}}",
+ "github.connections.manageOnGithub": "Manage on GitHub",
+ "github.connections.notConfigured": "This deployment has no GitHub App configured, so connecting is unavailable. Ask an administrator to set the GitHub App environment variables.",
+ "github.connections.organization": "Organization",
+ "github.connections.personal": "Personal account",
+ "github.connections.selectedRepositories": "{{count}} repositories",
+ "github.connections.status.connected": "Connected",
+ "github.connections.status.suspended": "Suspended",
+ "github.connections.title": "Connections",
+ "github.info.docsLink": "Read the guide",
+ "github.info.enabledBy": "Enabled by",
+ "github.info.notConfigured": "Not configured on this deployment",
+ "github.info.notConnected": "Not connected",
+ "github.info.status": "Status",
+ "github.installResult.error.exchange_failed": "GitHub did not accept the authorization code. Please try connecting again.",
+ "github.installResult.error.identity_taken": "This GitHub account is already linked to another LobeHub user.",
+ "github.installResult.error.installation_fetch_failed": "Could not read the installation from GitHub. Please try again.",
+ "github.installResult.error.missing_installation": "GitHub did not report an installation.",
+ "github.installResult.error.unknown": "Connecting GitHub failed ({{code}}).",
+ "github.installResult.error.workspace_forbidden": "Only workspace members can connect GitHub here.",
+ "github.installResult.success": "GitHub connected: {{account}}",
+ "github.installResult.updated": "GitHub installation updated",
+ "github.pending.confirm": "Connect",
+ "github.pending.content": "GitHub reports that the LobeHub app was installed on {{account}}. Connect that installation to this account? Its pull requests will be tracked here.",
+ "github.pending.failed": "Could not connect the installation. Please try again from Connect account.",
+ "github.pending.title": "Connect GitHub installation",
+ "github.tagline": "Sync pull requests, CI results and reviews with your agents",
+ "origin.event.ci_failed": "CI failed",
+ "origin.event.review_changes_requested": "Changes requested",
+ "origin.event.review_commented": "Review comment",
+ "origin.provider.github": "GitHub",
+ "overview.all": "All integrations",
+ "overview.comingSoon": "Coming soon",
+ "overview.description": "Connect the platforms you already use",
+ "overview.enabled": "Enabled",
+ "overview.status.comingSoon": "Coming soon",
+ "overview.status.enabled": "Enabled",
+ "overview.status.notConnected": "Not connected",
+ "overview.title": "Integrations",
+ "upcoming.cloudflare.tagline": "Notify the agent when a Workers or Pages build fails",
+ "upcoming.notion.tagline": "Sync Notion documents automatically",
+ "upcoming.railway.tagline": "Notify the agent when a deploy fails or a service crashes",
+ "upcoming.vercel.tagline": "Wake the agent with the build log when a deployment fails"
+}
diff --git a/locales/en-US/labs.json b/locales/en-US/labs.json
index 110738d1b55..161090d58eb 100644
--- a/locales/en-US/labs.json
+++ b/locales/en-US/labs.json
@@ -28,6 +28,8 @@
"features.inAppBrowser.title": "In-App Browser",
"features.inputMarkdown.desc": "Render Markdown in the input area in real time (bold text, code blocks, tables, etc.).",
"features.inputMarkdown.title": "Input Markdown Rendering",
+ "features.integrations.desc": "Show the Integrations settings page: connect the GitHub App so merged pull requests accept deliveries and failing checks or reviews reach the agent that opened them. Hidden by default.",
+ "features.integrations.title": "Integrations",
"features.messageTextSelectionActions.desc": "Show a quick action when selecting text in chat messages so the selected text can be added to the next conversation context.",
"features.messageTextSelectionActions.title": "Message Text Selection Actions",
"features.oauthApps.desc": "Show OAuth app management in personal and workspace settings. This feature is hidden by default.",
diff --git a/locales/en-US/scm.json b/locales/en-US/scm.json
new file mode 100644
index 00000000000..58261c57e79
--- /dev/null
+++ b/locales/en-US/scm.json
@@ -0,0 +1,50 @@
+{
+ "github.changeRequests.ci.failure": "CI failed",
+ "github.changeRequests.ci.pending": "CI running",
+ "github.changeRequests.ci.success": "CI passed",
+ "github.changeRequests.ci.unknown": "No CI",
+ "github.changeRequests.description": "Pull requests in your connected repositories. CI results, reviews and merges arrive here as they happen on GitHub.",
+ "github.changeRequests.draft": "Draft",
+ "github.changeRequests.empty": "No pull requests tracked yet. Open one in a connected repository and it will show up here.",
+ "github.changeRequests.event.ci_failed": "A check failed",
+ "github.changeRequests.event.ci_passed": "All checks passed",
+ "github.changeRequests.event.closed": "Closed",
+ "github.changeRequests.event.conflict": "Has conflicts",
+ "github.changeRequests.event.merged": "Merged",
+ "github.changeRequests.event.opened": "Opened",
+ "github.changeRequests.event.ready_for_review": "Ready for review",
+ "github.changeRequests.event.reopened": "Reopened",
+ "github.changeRequests.event.review_approved": "Approved",
+ "github.changeRequests.event.review_changes_requested": "Changes requested",
+ "github.changeRequests.event.review_commented": "Review comment",
+ "github.changeRequests.event.synchronized": "New commits pushed",
+ "github.changeRequests.linkedAcceptance": "Linked acceptance",
+ "github.changeRequests.review.approved": "Approved",
+ "github.changeRequests.review.changes_requested": "Changes requested",
+ "github.changeRequests.review.review_required": "Review required",
+ "github.changeRequests.state.closed": "Closed",
+ "github.changeRequests.state.merged": "Merged",
+ "github.changeRequests.state.open": "Open",
+ "github.changeRequests.title": "Pull requests",
+ "github.connect.action": "Connect GitHub",
+ "github.connect.addAnother": "Add another account",
+ "github.connect.description": "Install the LobeHub GitHub App on your account or organization. Your agents will hear about CI failures, review feedback and merges without polling.",
+ "github.connect.disabled": "The GitHub App is not configured on this deployment.",
+ "github.connect.identity": "Signed in to GitHub as {{login}}",
+ "github.connect.title": "GitHub",
+ "github.installResult.error.exchange_failed": "GitHub did not accept the authorization code. Please try connecting again.",
+ "github.installResult.error.identity_taken": "This GitHub account is already linked to another LobeHub user.",
+ "github.installResult.error.installation_fetch_failed": "Could not read the installation from GitHub. Please try again.",
+ "github.installResult.error.missing_installation": "GitHub did not report an installation.",
+ "github.installResult.error.unknown": "Connecting GitHub failed ({{code}}).",
+ "github.installResult.success": "GitHub connected: {{account}}",
+ "github.installResult.updated": "GitHub installation updated",
+ "github.installations.allRepositories": "All repositories",
+ "github.installations.empty": "No GitHub account connected yet.",
+ "github.installations.manage": "Manage on GitHub",
+ "github.installations.organization": "Organization",
+ "github.installations.selectedRepositories": "{{count}} repositories",
+ "github.installations.suspended": "Suspended",
+ "github.installations.title": "Connected accounts",
+ "github.installations.user": "Personal account"
+}
diff --git a/locales/en-US/setting.json b/locales/en-US/setting.json
index 71db803cd0c..30584884fbd 100644
--- a/locales/en-US/setting.json
+++ b/locales/en-US/setting.json
@@ -1237,6 +1237,7 @@
"settingsSearch.tabKeywords.creds": "credentials, secrets, oauth",
"settingsSearch.tabKeywords.devices": "devices, sessions, logged in devices",
"settingsSearch.tabKeywords.hotkey": "hotkey, shortcut, keyboard",
+ "settingsSearch.tabKeywords.integrations": "integrations, github, pull request, ci, review, merge, repository",
"settingsSearch.tabKeywords.labels": "labels, tags, grouping",
"settingsSearch.tabKeywords.labs": "labs, experiment, beta, preview, developer",
"settingsSearch.tabKeywords.memory": "memory, memories, personalization",
@@ -1450,6 +1451,7 @@
"tab.importFromGithub.desc": "Import from a public GitHub repository",
"tab.importFromUrl": "Import from URL",
"tab.importFromUrl.desc": "Import via a direct link to SKILL.md",
+ "tab.integrations": "Integrations",
"tab.labels": "Labels",
"tab.llm": "Language Model",
"tab.manualFill": "Manually Fill In",
diff --git a/locales/zh-CN/integration.json b/locales/zh-CN/integration.json
new file mode 100644
index 00000000000..304afd8a0c2
--- /dev/null
+++ b/locales/zh-CN/integration.json
@@ -0,0 +1,63 @@
+{
+ "github.automation.acceptOnMerge.description": "关联了验收的 Pull Request 被合并时,自动把验收标为已接受并完成对应任务。",
+ "github.automation.acceptOnMerge.title": "合并即验收通过",
+ "github.automation.description": "GitHub 上有动静时,LobeHub 自动做的事。",
+ "github.automation.title": "自动化",
+ "github.automation.wakeOnCiFailure.description": "检查失败时,带着失败 job 的日志通知开这个 Pull Request 的智能体。每个 Pull Request 最多三次。",
+ "github.automation.wakeOnCiFailure.title": "CI 失败时通知智能体",
+ "github.automation.wakeOnReview.description": "评审者要求修改或留下评论时,把意见送到开这个 Pull Request 的智能体。",
+ "github.automation.wakeOnReview.title": "评审反馈时通知智能体",
+ "github.comments.commentOnPrivateRepositories.description": "在 Pull Request 下留一条评论,附上它对应的验收和会话链接。",
+ "github.comments.commentOnPrivateRepositories.title": "私有仓库",
+ "github.comments.commentOnPublicRepositories.description": "默认关闭:公开讨论区不适合放指向你工作区的链接。",
+ "github.comments.commentOnPublicRepositories.title": "公开仓库",
+ "github.comments.description": "在 Pull Request 上留评论,链接回 LobeHub 的验收与会话。",
+ "github.comments.title": "在 GitHub 上评论",
+ "github.connections.allRepositories": "所有仓库",
+ "github.connections.connect": "连接账号",
+ "github.connections.connectedOn": "{{date}} 连接",
+ "github.connections.empty": "还没有连接账号。把 LobeHub 应用安装到你的 GitHub 账号或组织即可开始。",
+ "github.connections.enabledBy": "由 {{login}} 启用 · {{date}}",
+ "github.connections.manageOnGithub": "在 GitHub 上管理",
+ "github.connections.notConfigured": "当前部署没有配置 GitHub App,无法连接。请让管理员补上 GitHub App 的环境变量。",
+ "github.connections.organization": "组织",
+ "github.connections.personal": "个人账号",
+ "github.connections.selectedRepositories": "{{count}} 个仓库",
+ "github.connections.status.connected": "已连接",
+ "github.connections.status.suspended": "已暂停",
+ "github.connections.title": "连接",
+ "github.info.docsLink": "查看指南",
+ "github.info.enabledBy": "启用者",
+ "github.info.notConfigured": "当前部署未配置",
+ "github.info.notConnected": "未连接",
+ "github.info.status": "状态",
+ "github.installResult.error.exchange_failed": "GitHub 没有接受授权码,请重新连接。",
+ "github.installResult.error.identity_taken": "这个 GitHub 账号已经关联到另一个 LobeHub 用户。",
+ "github.installResult.error.installation_fetch_failed": "无法从 GitHub 读取安装信息,请重试。",
+ "github.installResult.error.missing_installation": "GitHub 没有返回安装信息。",
+ "github.installResult.error.unknown": "连接 GitHub 失败({{code}})。",
+ "github.installResult.error.workspace_forbidden": "只有工作区成员才能在这里连接 GitHub。",
+ "github.installResult.success": "GitHub 已连接:{{account}}",
+ "github.installResult.updated": "GitHub 安装已更新",
+ "github.pending.confirm": "连接",
+ "github.pending.content": "GitHub 报告 LobeHub 应用已安装到 {{account}}。要把这个安装连接到当前账号吗?连接后它的 Pull Request 会在这里被跟踪。",
+ "github.pending.failed": "连接安装失败,请从「连接账号」重试。",
+ "github.pending.title": "连接 GitHub 安装",
+ "github.tagline": "把 Pull Request、CI 结果和评审同步给你的智能体",
+ "origin.event.ci_failed": "CI 失败",
+ "origin.event.review_changes_requested": "要求修改",
+ "origin.event.review_commented": "评审评论",
+ "origin.provider.github": "GitHub",
+ "overview.all": "全部集成",
+ "overview.comingSoon": "即将支持",
+ "overview.description": "连接到你正在使用的平台",
+ "overview.enabled": "已启用",
+ "overview.status.comingSoon": "即将支持",
+ "overview.status.enabled": "已启用",
+ "overview.status.notConnected": "未连接",
+ "overview.title": "集成",
+ "upcoming.cloudflare.tagline": "Workers / Pages 构建失败时通知智能体",
+ "upcoming.notion.tagline": "自动同步 Notion 文档",
+ "upcoming.railway.tagline": "部署失败或服务崩溃时通知智能体",
+ "upcoming.vercel.tagline": "部署失败时把构建日志送给智能体"
+}
diff --git a/locales/zh-CN/labs.json b/locales/zh-CN/labs.json
index 38d37a56671..c8fb43918cb 100644
--- a/locales/zh-CN/labs.json
+++ b/locales/zh-CN/labs.json
@@ -28,6 +28,8 @@
"features.inAppBrowser.title": "内置浏览器",
"features.inputMarkdown.desc": "在输入区域实时渲染 Markdown(粗体、代码块、表格等)",
"features.inputMarkdown.title": "输入框 Markdown 渲染",
+ "features.integrations.desc": "显示「集成」设置页:连接 GitHub App 后,合并 PR 自动验收通过,CI 失败或评审意见会送到开这个 PR 的智能体。默认隐藏。",
+ "features.integrations.title": "集成",
"features.messageTextSelectionActions.desc": "在聊天消息中选中文本时显示快捷操作,可将选中的文本加入下一次对话上下文。",
"features.messageTextSelectionActions.title": "消息文本选择操作",
"features.oauthApps.desc": "在个人和工作区设置中显示 OAuth 应用管理入口。此功能默认隐藏。",
diff --git a/locales/zh-CN/scm.json b/locales/zh-CN/scm.json
new file mode 100644
index 00000000000..08be7e91050
--- /dev/null
+++ b/locales/zh-CN/scm.json
@@ -0,0 +1,50 @@
+{
+ "github.changeRequests.ci.failure": "CI 失败",
+ "github.changeRequests.ci.pending": "CI 运行中",
+ "github.changeRequests.ci.success": "CI 通过",
+ "github.changeRequests.ci.unknown": "无 CI",
+ "github.changeRequests.description": "已连接仓库里的 Pull Request。CI 结果、评审和合并会随 GitHub 上的变化实时出现在这里。",
+ "github.changeRequests.draft": "草稿",
+ "github.changeRequests.empty": "还没有跟踪到 Pull Request。在已连接的仓库里开一个,它就会出现在这里。",
+ "github.changeRequests.event.ci_failed": "有检查失败",
+ "github.changeRequests.event.ci_passed": "所有检查通过",
+ "github.changeRequests.event.closed": "已关闭",
+ "github.changeRequests.event.conflict": "存在冲突",
+ "github.changeRequests.event.merged": "已合并",
+ "github.changeRequests.event.opened": "已创建",
+ "github.changeRequests.event.ready_for_review": "可以评审",
+ "github.changeRequests.event.reopened": "已重新打开",
+ "github.changeRequests.event.review_approved": "评审通过",
+ "github.changeRequests.event.review_changes_requested": "评审要求修改",
+ "github.changeRequests.event.review_commented": "评审评论",
+ "github.changeRequests.event.synchronized": "推送了新提交",
+ "github.changeRequests.linkedAcceptance": "关联验收",
+ "github.changeRequests.review.approved": "已批准",
+ "github.changeRequests.review.changes_requested": "要求修改",
+ "github.changeRequests.review.review_required": "待评审",
+ "github.changeRequests.state.closed": "已关闭",
+ "github.changeRequests.state.merged": "已合并",
+ "github.changeRequests.state.open": "进行中",
+ "github.changeRequests.title": "Pull Request",
+ "github.connect.action": "连接 GitHub",
+ "github.connect.addAnother": "再连接一个账号",
+ "github.connect.description": "把 LobeHub GitHub App 安装到你的账号或组织。之后 CI 失败、评审意见和合并会自动通知你的智能体,不再需要轮询。",
+ "github.connect.disabled": "当前部署没有配置 GitHub App。",
+ "github.connect.identity": "已以 {{login}} 登录 GitHub",
+ "github.connect.title": "GitHub",
+ "github.installResult.error.exchange_failed": "GitHub 没有接受授权码,请重新连接。",
+ "github.installResult.error.identity_taken": "这个 GitHub 账号已经关联到另一个 LobeHub 用户。",
+ "github.installResult.error.installation_fetch_failed": "无法从 GitHub 读取安装信息,请重试。",
+ "github.installResult.error.missing_installation": "GitHub 没有返回安装信息。",
+ "github.installResult.error.unknown": "连接 GitHub 失败({{code}})。",
+ "github.installResult.success": "GitHub 已连接:{{account}}",
+ "github.installResult.updated": "GitHub 安装已更新",
+ "github.installations.allRepositories": "所有仓库",
+ "github.installations.empty": "还没有连接 GitHub 账号。",
+ "github.installations.manage": "在 GitHub 上管理",
+ "github.installations.organization": "组织",
+ "github.installations.selectedRepositories": "{{count}} 个仓库",
+ "github.installations.suspended": "已暂停",
+ "github.installations.title": "已连接账号",
+ "github.installations.user": "个人账号"
+}
diff --git a/locales/zh-CN/setting.json b/locales/zh-CN/setting.json
index 7d5e28f7b97..810f451b37c 100644
--- a/locales/zh-CN/setting.json
+++ b/locales/zh-CN/setting.json
@@ -1237,6 +1237,7 @@
"settingsSearch.tabKeywords.creds": "凭证,密钥,授权",
"settingsSearch.tabKeywords.devices": "设备,会话,登录设备",
"settingsSearch.tabKeywords.hotkey": "快捷键,键盘,热键",
+ "settingsSearch.tabKeywords.integrations": "集成, integrations, github, pull request, ci, 评审, 合并, 仓库",
"settingsSearch.tabKeywords.labels": "标签, 分组, 标记",
"settingsSearch.tabKeywords.labs": "实验室,实验功能",
"settingsSearch.tabKeywords.memory": "记忆,个性化",
@@ -1450,6 +1451,7 @@
"tab.importFromGithub.desc": "从公开的 GitHub 仓库导入",
"tab.importFromUrl": "从 URL 导入",
"tab.importFromUrl.desc": "通过 SKILL.md 的直接链接导入",
+ "tab.integrations": "集成",
"tab.labels": "标签",
"tab.llm": "语言模型",
"tab.manualFill": "自行填写内容",
diff --git a/packages/locales/src/default/index.ts b/packages/locales/src/default/index.ts
index d558dff5811..3b3a981a456 100644
--- a/packages/locales/src/default/index.ts
+++ b/packages/locales/src/default/index.ts
@@ -18,6 +18,7 @@ import file from './file';
import home from './home';
import hotkey from './hotkey';
import image from './image';
+import integration from './integration';
import knowledgeBase from './knowledgeBase';
import labs from './labs';
import marketAuth from './marketAuth';
@@ -73,6 +74,7 @@ const resources = {
home,
hotkey,
image,
+ integration,
knowledgeBase,
labs,
marketAuth,
diff --git a/packages/locales/src/default/integration.ts b/packages/locales/src/default/integration.ts
new file mode 100644
index 00000000000..9497aec0aee
--- /dev/null
+++ b/packages/locales/src/default/integration.ts
@@ -0,0 +1,77 @@
+export default {
+ 'github.automation.acceptOnMerge.description':
+ 'When a pull request linked to an acceptance is merged, mark the acceptance as accepted and complete its task.',
+ 'github.automation.acceptOnMerge.title': 'Accept deliveries on merge',
+ 'github.automation.description': 'What LobeHub does on its own when GitHub reports activity.',
+ 'github.automation.title': 'Automation',
+ 'github.automation.wakeOnCiFailure.description':
+ 'When a check fails, notify the agent that opened the pull request with the failing job log. At most three times per pull request.',
+ 'github.automation.wakeOnCiFailure.title': 'Notify agents on CI failure',
+ 'github.automation.wakeOnReview.description':
+ 'When a reviewer requests changes or comments, deliver the feedback to the agent that opened the pull request.',
+ 'github.automation.wakeOnReview.title': 'Notify agents on review feedback',
+ 'github.comments.commentOnPrivateRepositories.description':
+ 'Post one comment linking the acceptance and the conversation behind the pull request.',
+ 'github.comments.commentOnPrivateRepositories.title': 'Private repositories',
+ 'github.comments.commentOnPublicRepositories.description':
+ 'Off by default: a public thread is not the place for links into your workspace.',
+ 'github.comments.commentOnPublicRepositories.title': 'Public repositories',
+ 'github.comments.description':
+ 'Leave a comment on pull requests with links back to the LobeHub acceptance and conversation.',
+ 'github.comments.title': 'Comments in GitHub',
+ 'github.connections.allRepositories': 'All repositories',
+ 'github.connections.connect': 'Connect account',
+ 'github.connections.connectedOn': 'Connected {{date}}',
+ 'github.connections.empty':
+ 'No account connected yet. Install the LobeHub app on your GitHub account or organization to get started.',
+ 'github.connections.enabledBy': 'Enabled by {{login}} · {{date}}',
+ 'github.connections.manageOnGithub': 'Manage on GitHub',
+ 'github.connections.notConfigured':
+ 'This deployment has no GitHub App configured, so connecting is unavailable. Ask an administrator to set the GitHub App environment variables.',
+ 'github.connections.organization': 'Organization',
+ 'github.connections.personal': 'Personal account',
+ 'github.connections.selectedRepositories': '{{count}} repositories',
+ 'github.connections.status.connected': 'Connected',
+ 'github.connections.status.suspended': 'Suspended',
+ 'github.connections.title': 'Connections',
+ 'github.info.docsLink': 'Read the guide',
+ 'github.info.enabledBy': 'Enabled by',
+ 'github.info.notConfigured': 'Not configured on this deployment',
+ 'github.info.notConnected': 'Not connected',
+ 'github.info.status': 'Status',
+ 'github.installResult.error.exchange_failed':
+ 'GitHub did not accept the authorization code. Please try connecting again.',
+ 'github.installResult.error.identity_taken':
+ 'This GitHub account is already linked to another LobeHub user.',
+ 'github.installResult.error.installation_fetch_failed':
+ 'Could not read the installation from GitHub. Please try again.',
+ 'github.installResult.error.missing_installation': 'GitHub did not report an installation.',
+ 'github.installResult.error.unknown': 'Connecting GitHub failed ({{code}}).',
+ 'github.installResult.error.workspace_forbidden':
+ 'Only workspace members can connect GitHub here.',
+ 'github.installResult.success': 'GitHub connected: {{account}}',
+ 'github.installResult.updated': 'GitHub installation updated',
+ 'github.pending.confirm': 'Connect',
+ 'github.pending.content':
+ 'GitHub reports that the LobeHub app was installed on {{account}}. Connect that installation to this account? Its pull requests will be tracked here.',
+ 'github.pending.failed':
+ 'Could not connect the installation. Please try again from Connect account.',
+ 'github.pending.title': 'Connect GitHub installation',
+ 'github.tagline': 'Sync pull requests, CI results and reviews with your agents',
+ 'origin.event.ci_failed': 'CI failed',
+ 'origin.event.review_changes_requested': 'Changes requested',
+ 'origin.event.review_commented': 'Review comment',
+ 'origin.provider.github': 'GitHub',
+ 'overview.all': 'All integrations',
+ 'overview.comingSoon': 'Coming soon',
+ 'overview.description': 'Connect the platforms you already use',
+ 'overview.enabled': 'Enabled',
+ 'overview.status.comingSoon': 'Coming soon',
+ 'overview.status.enabled': 'Enabled',
+ 'overview.status.notConnected': 'Not connected',
+ 'overview.title': 'Integrations',
+ 'upcoming.cloudflare.tagline': 'Notify the agent when a Workers or Pages build fails',
+ 'upcoming.notion.tagline': 'Sync Notion documents automatically',
+ 'upcoming.railway.tagline': 'Notify the agent when a deploy fails or a service crashes',
+ 'upcoming.vercel.tagline': 'Wake the agent with the build log when a deployment fails',
+};
diff --git a/packages/locales/src/default/labs.ts b/packages/locales/src/default/labs.ts
index f246b8d0c44..6126cfc20d2 100644
--- a/packages/locales/src/default/labs.ts
+++ b/packages/locales/src/default/labs.ts
@@ -41,6 +41,9 @@ export default {
'features.groupChat.title': 'Group Chat (Multi-Agent)',
'features.inputMarkdown.desc':
'Render Markdown in the input area in real time (bold text, code blocks, tables, etc.).',
+ 'features.integrations.desc':
+ 'Show the Integrations settings page: connect the GitHub App so merged pull requests accept deliveries and failing checks or reviews reach the agent that opened them. Hidden by default.',
+ 'features.integrations.title': 'Integrations',
'features.inputMarkdown.title': 'Input Markdown Rendering',
'features.messageTextSelectionActions.desc':
'Show a quick action when selecting text in chat messages so the selected text can be added to the next conversation context.',
diff --git a/packages/locales/src/default/scm.ts b/packages/locales/src/default/scm.ts
new file mode 100644
index 00000000000..92271e73174
--- /dev/null
+++ b/packages/locales/src/default/scm.ts
@@ -0,0 +1,56 @@
+export default {
+ 'github.changeRequests.ci.failure': 'CI failed',
+ 'github.changeRequests.ci.pending': 'CI running',
+ 'github.changeRequests.ci.success': 'CI passed',
+ 'github.changeRequests.ci.unknown': 'No CI',
+ 'github.changeRequests.description':
+ 'Pull requests in your connected repositories. CI results, reviews and merges arrive here as they happen on GitHub.',
+ 'github.changeRequests.draft': 'Draft',
+ 'github.changeRequests.empty':
+ 'No pull requests tracked yet. Open one in a connected repository and it will show up here.',
+ 'github.changeRequests.event.ci_failed': 'A check failed',
+ 'github.changeRequests.event.ci_passed': 'All checks passed',
+ 'github.changeRequests.event.closed': 'Closed',
+ 'github.changeRequests.event.conflict': 'Has conflicts',
+ 'github.changeRequests.event.merged': 'Merged',
+ 'github.changeRequests.event.opened': 'Opened',
+ 'github.changeRequests.event.ready_for_review': 'Ready for review',
+ 'github.changeRequests.event.reopened': 'Reopened',
+ 'github.changeRequests.event.review_approved': 'Approved',
+ 'github.changeRequests.event.review_changes_requested': 'Changes requested',
+ 'github.changeRequests.event.review_commented': 'Review comment',
+ 'github.changeRequests.event.synchronized': 'New commits pushed',
+ 'github.changeRequests.linkedAcceptance': 'Linked acceptance',
+ 'github.changeRequests.review.approved': 'Approved',
+ 'github.changeRequests.review.changes_requested': 'Changes requested',
+ 'github.changeRequests.review.review_required': 'Review required',
+ 'github.changeRequests.state.closed': 'Closed',
+ 'github.changeRequests.state.merged': 'Merged',
+ 'github.changeRequests.state.open': 'Open',
+ 'github.changeRequests.title': 'Pull requests',
+ 'github.connect.action': 'Connect GitHub',
+ 'github.connect.addAnother': 'Add another account',
+ 'github.connect.description':
+ 'Install the LobeHub GitHub App on your account or organization. Your agents will hear about CI failures, review feedback and merges without polling.',
+ 'github.connect.disabled': 'The GitHub App is not configured on this deployment.',
+ 'github.connect.identity': 'Signed in to GitHub as {{login}}',
+ 'github.connect.title': 'GitHub',
+ 'github.installResult.error.exchange_failed':
+ 'GitHub did not accept the authorization code. Please try connecting again.',
+ 'github.installResult.error.identity_taken':
+ 'This GitHub account is already linked to another LobeHub user.',
+ 'github.installResult.error.installation_fetch_failed':
+ 'Could not read the installation from GitHub. Please try again.',
+ 'github.installResult.error.missing_installation': 'GitHub did not report an installation.',
+ 'github.installResult.error.unknown': 'Connecting GitHub failed ({{code}}).',
+ 'github.installResult.success': 'GitHub connected: {{account}}',
+ 'github.installResult.updated': 'GitHub installation updated',
+ 'github.installations.allRepositories': 'All repositories',
+ 'github.installations.empty': 'No GitHub account connected yet.',
+ 'github.installations.manage': 'Manage on GitHub',
+ 'github.installations.organization': 'Organization',
+ 'github.installations.selectedRepositories': '{{count}} repositories',
+ 'github.installations.suspended': 'Suspended',
+ 'github.installations.title': 'Connected accounts',
+ 'github.installations.user': 'Personal account',
+};
diff --git a/packages/locales/src/default/setting.ts b/packages/locales/src/default/setting.ts
index 403c3024723..ef84dc91454 100644
--- a/packages/locales/src/default/setting.ts
+++ b/packages/locales/src/default/setting.ts
@@ -1347,6 +1347,8 @@ export default {
'settingsSearch.tabKeywords.hotkey': 'hotkey, shortcut, keyboard',
'settingsSearch.tabKeywords.labels': 'labels, tags, grouping',
'settingsSearch.tabKeywords.labs': 'labs, experiment, beta, preview, developer',
+ 'settingsSearch.tabKeywords.integrations':
+ 'integrations, github, pull request, ci, review, merge, repository',
'settingsSearch.tabKeywords.memory': 'memory, memories, personalization',
'settingsSearch.tabKeywords.messenger':
'messenger, chat platform, bot, telegram, slack, discord, wechat',
@@ -1715,6 +1717,7 @@ When I am ___, I need ___
'tab.llm': 'Language Model',
'tab.manualFill': 'Manually Fill In',
'tab.manualFill.desc': 'Configure a custom MCP skill manually',
+ 'tab.integrations': 'Integrations',
'tab.memory': 'Memory',
'tab.messenger': 'Messenger',
'tab.notification': 'Notifications',
diff --git a/packages/types/src/user/preference.ts b/packages/types/src/user/preference.ts
index d4016d31aeb..b7f3cf46238 100644
--- a/packages/types/src/user/preference.ts
+++ b/packages/types/src/user/preference.ts
@@ -193,6 +193,11 @@ export const UserLabSchema = z.object({
* enable selecting message text and adding it to the next conversation context
*/
enableMessageTextSelectionActions: z.boolean().optional(),
+ /**
+ * show the Integrations settings page (GitHub App and the coming-soon
+ * directory); hidden until the closed loop leaves alpha
+ */
+ enableIntegrations: z.boolean().optional(),
/**
* show OAuth app management in personal and workspace settings
*/
@@ -225,6 +230,36 @@ export const UserLabSchema = z.object({
export type UserLab = z.infer<typeof UserLabSchema>;
+/** Automation switches for the GitHub integration. Every switch defaults to on. */
+export interface GithubIntegrationPreference {
+ /** Merging a linked pull request accepts its acceptance. */
+ acceptOnMerge?: boolean;
+ /** Post a LobeHub comment (acceptance + conversation links) on pull requests in private repositories. Default on. */
+ commentOnPrivateRepositories?: boolean;
+ /** Same for public repositories. Default off: a public thread is not the place for internal links. */
+ commentOnPublicRepositories?: boolean;
+ /** A failing check wakes the agent that opened the pull request. */
+ wakeOnCiFailure?: boolean;
+ /** Review feedback (changes requested, comments) wakes the agent. */
+ wakeOnReview?: boolean;
+}
+
+export interface UserIntegrationPreference {
+ github?: GithubIntegrationPreference;
+}
+
+export const GithubIntegrationPreferenceSchema = z.object({
+ acceptOnMerge: z.boolean().optional(),
+ commentOnPrivateRepositories: z.boolean().optional(),
+ commentOnPublicRepositories: z.boolean().optional(),
+ wakeOnCiFailure: z.boolean().optional(),
+ wakeOnReview: z.boolean().optional(),
+});
+
+export const UserIntegrationPreferenceSchema = z.object({
+ github: GithubIntegrationPreferenceSchema.optional(),
+});
+
export interface UserPreference {
/** Last-used app for "Open working directory in…" split button. Empty/unknown values fall back to platform default. */
defaultOpenInApp?: string;
@@ -243,6 +278,12 @@ export interface UserPreference {
/**
* lab experimental features
*/
+ /**
+ * Per-integration automation switches, edited on Settings → Integrations.
+ * Absent keys mean "on": the closed loop is the default, the switch is the
+ * opt-out.
+ */
+ integration?: UserIntegrationPreference;
lab?: UserLab;
/**
* Last active workspace id. Used on cloud to land the user back in the
@@ -334,6 +375,7 @@ export const UserPreferenceSchema = z
fontFamily: z.string().optional(),
guide: UserGuideSchema.optional(),
hideSyncAlert: z.boolean().optional(),
+ integration: UserIntegrationPreferenceSchema.optional(),
lab: UserLabSchema.optional(),
lastWorkspaceId: z.string().nullish(),
sidebarHiddenAgentIds: z.array(z.string()).optional(),
diff --git a/src/features/Integrations/Github/Automation.tsx b/src/features/Integrations/Github/Automation.tsx
new file mode 100644
index 00000000000..b80b537eca9
--- /dev/null
+++ b/src/features/Integrations/Github/Automation.tsx
@@ -0,0 +1,142 @@
+'use client';
+
+import type { GithubIntegrationPreference } from '@lobechat/types';
+import { Block, Flexbox, Icon } from '@lobehub/ui';
+import { Switch, Text } from '@lobehub/ui/base-ui';
+import { createStaticStyles } from 'antd-style';
+import {
+ CircleXIcon,
+ GitMergeIcon,
+ GlobeIcon,
+ LockIcon,
+ type LucideIcon,
+ MessageSquareTextIcon,
+} from 'lucide-react';
+import { memo } from 'react';
+import { useTranslation } from 'react-i18next';
+
+import { useUserStore } from '@/store/user';
+import { preferenceSelectors } from '@/store/user/selectors';
+
+const styles = createStaticStyles(({ css, cssVar }) => ({
+ card: css`
+ padding-block: 2px;
+ padding-inline: 16px;
+ border-radius: ${cssVar.borderRadiusLG};
+ background: ${cssVar.colorFillQuaternary};
+ `,
+ icon: css`
+ display: flex;
+ flex: none;
+ align-items: center;
+ justify-content: center;
+
+ width: 32px;
+ height: 32px;
+ border-radius: ${cssVar.borderRadius};
+
+ color: ${cssVar.colorTextSecondary};
+
+ background: ${cssVar.colorFillTertiary};
+ `,
+ row: css`
+ padding-block: 12px;
+
+ &:not(:last-child) {
+ border-block-end: 1px solid ${cssVar.colorBorderSecondary};
+ }
+ `,
+}));
+
+type SwitchKey = keyof GithubIntegrationPreference;
+
+/** One glyph per switch, so a row reads at a glance before the title does. */
+const ICONS: Record<SwitchKey, LucideIcon> = {
+ acceptOnMerge: GitMergeIcon,
+ commentOnPrivateRepositories: LockIcon,
+ commentOnPublicRepositories: GlobeIcon,
+ wakeOnCiFailure: CircleXIcon,
+ wakeOnReview: MessageSquareTextIcon,
+};
+
+interface SwitchGroup {
+ /** Switches whose absent value means on; the rest default to off. */
+ defaultOn: SwitchKey[];
+ id: 'automation' | 'comments';
+ keys: SwitchKey[];
+}
+
+const GROUPS: SwitchGroup[] = [
+ {
+ defaultOn: ['acceptOnMerge', 'wakeOnCiFailure', 'wakeOnReview'],
+ id: 'automation',
+ keys: ['acceptOnMerge', 'wakeOnCiFailure', 'wakeOnReview'],
+ },
+ {
+ defaultOn: ['commentOnPrivateRepositories'],
+ id: 'comments',
+ keys: ['commentOnPrivateRepositories', 'commentOnPublicRepositories'],
+ },
+];
+
+/**
+ * What LobeHub does on its own when GitHub reports activity, and what it
+ * writes back. The server reads the same preference before acting, so a
+ * switch here is the whole opt-out (or opt-in, for public-repo comments).
+ */
+const Automation = memo(() => {
+ const { t } = useTranslation('integration');
+ const [isPreferenceInit, preference, updatePreference] = useUserStore((s) => [
+ preferenceSelectors.isPreferenceInit(s),
+ s.preference.integration?.github,
+ s.updatePreference,
+ ]);
+
+ const toggle = (key: SwitchKey, next: boolean) =>
+ updatePreference({ integration: { github: { ...preference, [key]: next } } });
+
+ return (
+ <>
+ {GROUPS.map((group) => (
+ <Flexbox gap={12} key={group.id}>
+ <Flexbox gap={4}>
+ <Text strong style={{ fontSize: 16 }}>
+ {t(`github.${group.id}.title`)}
+ </Text>
+ <Text type="secondary">{t(`github.${group.id}.description`)}</Text>
+ </Flexbox>
+ <Block className={styles.card} variant={'filled'}>
+ {group.keys.map((key) => {
+ const checked = group.defaultOn.includes(key)
+ ? preference?.[key] !== false
+ : preference?.[key] === true;
+ return (
+ <Flexbox horizontal align="center" className={styles.row} gap={14} key={key}>
+ <span className={styles.icon}>
+ <Icon icon={ICONS[key]} size={16} />
+ </span>
+ <Flexbox flex={1} gap={2} style={{ minWidth: 0 }}>
+ <Text strong>{t(`github.${group.id}.${key}.title` as any)}</Text>
+ <Text style={{ fontSize: 13 }} type="secondary">
+ {t(`github.${group.id}.${key}.description` as any)}
+ </Text>
+ </Flexbox>
+ <Switch
+ checked={checked}
+ loading={!isPreferenceInit}
+ style={{ flex: 'none', marginInlineStart: 10 }}
+ onChange={(next: boolean) => toggle(key, next)}
+ />
+ </Flexbox>
+ );
+ })}
+ </Block>
+ </Flexbox>
+ ))}
+ </>
+ );
+});
+
+Automation.displayName = 'GithubIntegrationAutomation';
+
+export default Automation;
diff --git a/src/features/Integrations/Github/Connections.tsx b/src/features/Integrations/Github/Connections.tsx
new file mode 100644
index 00000000000..e813b11ff57
--- /dev/null
+++ b/src/features/Integrations/Github/Connections.tsx
@@ -0,0 +1,181 @@
+'use client';
+
+import type { ScmInstallationItem } from '@lobechat/database/schemas';
+import { Block, Flexbox, Icon } from '@lobehub/ui';
+import { Avatar, Button, DropdownMenu, Text } from '@lobehub/ui/base-ui';
+import { createStaticStyles } from 'antd-style';
+import { ChevronDownIcon, PlusIcon } from 'lucide-react';
+import { memo } from 'react';
+import { useTranslation } from 'react-i18next';
+
+const styles = createStaticStyles(({ css, cssVar }) => ({
+ card: css`
+ padding-block: 2px;
+ padding-inline: 16px;
+ border-radius: ${cssVar.borderRadiusLG};
+ background: ${cssVar.colorFillQuaternary};
+ `,
+ dot: css`
+ display: inline-block;
+ flex: none;
+
+ width: 6px;
+ height: 6px;
+ border-radius: 50%;
+
+ background: ${cssVar.colorSuccess};
+ `,
+ dotMuted: css`
+ background: ${cssVar.colorWarning};
+ `,
+ emptyState: css`
+ padding-block: 24px;
+ padding-inline: 20px;
+ border-radius: ${cssVar.borderRadiusLG};
+
+ color: ${cssVar.colorTextSecondary};
+ text-align: center;
+
+ background: ${cssVar.colorFillQuaternary};
+ `,
+ row: css`
+ padding-block: 10px;
+
+ &:not(:last-child) {
+ border-block-end: 1px solid ${cssVar.colorBorderSecondary};
+ }
+ `,
+ status: css`
+ cursor: pointer;
+ user-select: none;
+
+ display: inline-flex;
+ gap: 8px;
+ align-items: center;
+
+ padding-block: 4px;
+ padding-inline: 8px;
+ border-radius: ${cssVar.borderRadiusSM};
+
+ &:hover {
+ background: ${cssVar.colorFillTertiary};
+ }
+ `,
+}));
+
+/** Where GitHub lets the user change repositories or uninstall this installation. */
+const manageUrl = (item: ScmInstallationItem) =>
+ item.accountType === 'organization'
+ ? `https://github.com/organizations/${item.accountLogin}/settings/installations/${item.installationId}`
+ : `https://github.com/settings/installations/${item.installationId}`;
+
+interface ConnectionsProps {
+ /** False when the deployment has no GitHub App configured; connecting is impossible. */
+ configured: boolean;
+ installations: ScmInstallationItem[];
+ installHref?: string;
+ /** Workspace rows say who enabled them; personal rows belong to the viewer. */
+ scope: 'personal' | 'workspace';
+}
+
+/**
+ * Who is connected: every account or organization the App is installed on.
+ * Repository changes and uninstalls happen on GitHub, so each row hands off
+ * there.
+ */
+const Connections = memo<ConnectionsProps>(({ configured, installHref, installations, scope }) => {
+ const { t } = useTranslation('integration');
+
+ return (
+ <Flexbox gap={10}>
+ <Flexbox horizontal align="center" gap={16} justify="space-between">
+ <Text strong style={{ fontSize: 16 }}>
+ {t('github.connections.title')}
+ </Text>
+ <Button
+ disabled={!installHref}
+ href={installHref}
+ icon={<Icon icon={PlusIcon} />}
+ size="small"
+ type={installations.length > 0 ? 'default' : 'primary'}
+ >
+ {t('github.connections.connect')}
+ </Button>
+ </Flexbox>
+
+ {/* A dead button with no reason beside it is the worst of both. */}
+ {configured ? null : (
+ <Text style={{ fontSize: 13 }} type="secondary">
+ {t('github.connections.notConfigured')}
+ </Text>
+ )}
+
+ {installations.length === 0 ? (
+ <div className={styles.emptyState}>{t('github.connections.empty')}</div>
+ ) : (
+ <Block className={styles.card} variant={'filled'}>
+ {installations.map((item) => {
+ const repositories =
+ item.repositorySelection === 'all'
+ ? t('github.connections.allRepositories')
+ : t('github.connections.selectedRepositories', {
+ count: item.repositories.length,
+ });
+ const kind =
+ item.accountType === 'organization'
+ ? t('github.connections.organization')
+ : t('github.connections.personal');
+ const date = new Date(item.createdAt).toLocaleDateString();
+ const detail =
+ scope === 'workspace'
+ ? `${kind} · ${repositories} · ${t('github.connections.enabledBy', {
+ date,
+ login: item.installedByExternalLogin ?? item.accountLogin,
+ })}`
+ : `${kind} · ${repositories} · ${t('github.connections.connectedOn', { date })}`;
+ const suspended = Boolean(item.suspendedAt);
+ return (
+ <Flexbox horizontal align="center" className={styles.row} gap={12} key={item.id}>
+ <Avatar
+ avatar={item.metadata.accountAvatarUrl ?? undefined}
+ size={36}
+ title={item.accountLogin}
+ />
+ <Flexbox flex={1} gap={1} style={{ minWidth: 0 }}>
+ <Text strong>{item.accountLogin}</Text>
+ <Text style={{ fontSize: 13 }} type="secondary">
+ {detail}
+ </Text>
+ </Flexbox>
+ <DropdownMenu
+ placement="bottomRight"
+ items={[
+ {
+ key: 'manage',
+ label: t('github.connections.manageOnGithub'),
+ onClick: () => window.open(manageUrl(item), '_blank', 'noreferrer'),
+ },
+ ]}
+ >
+ <span className={styles.status}>
+ <span className={`${styles.dot} ${suspended ? styles.dotMuted : ''}`} />
+ <Text>
+ {suspended
+ ? t('github.connections.status.suspended')
+ : t('github.connections.status.connected')}
+ </Text>
+ <Icon icon={ChevronDownIcon} size="small" />
+ </span>
+ </DropdownMenu>
+ </Flexbox>
+ );
+ })}
+ </Block>
+ )}
+ </Flexbox>
+ );
+});
+
+Connections.displayName = 'GithubIntegrationConnections';
+
+export default Connections;
diff --git a/src/features/Integrations/Github/definition.ts b/src/features/Integrations/Github/definition.ts
new file mode 100644
index 00000000000..e2c3707dd48
--- /dev/null
+++ b/src/features/Integrations/Github/definition.ts
@@ -0,0 +1,12 @@
+import { Github } from '@lobehub/icons';
+
+import { type IntegrationDefinition, registerIntegration } from '../registry';
+
+export const GITHUB_INTEGRATION: IntegrationDefinition = {
+ docsUrl: 'https://lobehub.com/docs/usage/integrations/github',
+ icon: Github,
+ id: 'github',
+ name: 'GitHub',
+};
+
+registerIntegration(GITHUB_INTEGRATION);
diff --git a/src/features/Integrations/Github/index.tsx b/src/features/Integrations/Github/index.tsx
new file mode 100644
index 00000000000..4446c694e08
--- /dev/null
+++ b/src/features/Integrations/Github/index.tsx
@@ -0,0 +1,234 @@
+'use client';
+
+import { Block, Flexbox, Icon } from '@lobehub/ui';
+import { Avatar, confirmModal, Skeleton, Text, toast } from '@lobehub/ui/base-ui';
+import { createStaticStyles } from 'antd-style';
+import { ArrowLeftIcon, BookOpenIcon } from 'lucide-react';
+import { memo, useEffect } from 'react';
+import { useTranslation } from 'react-i18next';
+
+import { useActiveWorkspaceId } from '@/business/client/hooks/useActiveWorkspaceId';
+import { useActiveWorkspaceSlug } from '@/business/client/hooks/useActiveWorkspaceSlug';
+import AsyncError from '@/components/AsyncError';
+import { useAppOrigin } from '@/hooks/useAppOrigin';
+import { scmService } from '@/services/scm';
+
+import { useGithubIntegration } from '../useGithubIntegration';
+import Automation from './Automation';
+import Connections from './Connections';
+import { GITHUB_INTEGRATION } from './definition';
+import { buildGithubInstallHref } from './installHref';
+
+const styles = createStaticStyles(({ css, cssVar }) => ({
+ back: css`
+ cursor: pointer;
+
+ display: inline-flex;
+ gap: 6px;
+ align-items: center;
+
+ color: ${cssVar.colorTextSecondary};
+
+ &:hover {
+ color: ${cssVar.colorText};
+ }
+ `,
+ docs: css`
+ display: inline-flex;
+ gap: 6px;
+ align-items: center;
+ color: ${cssVar.colorTextSecondary};
+
+ &:hover {
+ color: ${cssVar.colorText};
+ }
+ `,
+ hero: css`
+ display: flex;
+ flex: none;
+ align-items: center;
+ justify-content: center;
+
+ width: 56px;
+ height: 56px;
+ border-radius: ${cssVar.borderRadiusLG};
+
+ color: ${cssVar.colorText};
+
+ background: ${cssVar.colorFillTertiary};
+ `,
+ infoBar: css`
+ padding-block: 10px;
+ padding-inline: 16px;
+ border-radius: ${cssVar.borderRadiusLG};
+ `,
+ infoLabel: css`
+ font-size: 11px;
+ font-weight: 500;
+ color: ${cssVar.colorTextTertiary};
+ text-transform: uppercase;
+ letter-spacing: 0.04em;
+ `,
+}));
+
+const KNOWN_ERRORS = new Set([
+ 'exchange_failed',
+ 'identity_taken',
+ 'installation_fetch_failed',
+ 'missing_installation',
+ 'workspace_forbidden',
+]);
+
+interface GithubIntegrationProps {
+ onBack: () => void;
+}
+
+/**
+ * The GitHub integration page: what it does, the connected accounts and the
+ * automation switches. In a workspace an info bar also says who enabled it.
+ * Connecting hands off to the server route that owns the GitHub handshake;
+ * GitHub sends the user back here with the outcome in the query.
+ */
+const GithubIntegration = memo<GithubIntegrationProps>(({ onBack }) => {
+ const { t, ready } = useTranslation('integration');
+ const appOrigin = useAppOrigin();
+ const workspaceSlug = useActiveWorkspaceSlug();
+ const workspaceId = useActiveWorkspaceId();
+ const scope = workspaceSlug ? 'workspace' : 'personal';
+ const data = useGithubIntegration();
+
+ useEffect(() => {
+ if (typeof window === 'undefined' || !ready) return;
+ const url = new URL(window.location.href);
+ const installed = url.searchParams.get('installed');
+ const error = url.searchParams.get('error');
+ const account = url.searchParams.get('account');
+ const pending = url.searchParams.get('pending');
+ if (!installed && !error && !pending) return;
+
+ if (installed === 'ok') toast.success(t('github.installResult.success', { account }));
+ else if (installed === 'updated') toast.success(t('github.installResult.updated'));
+ else if (error && KNOWN_ERRORS.has(error)) {
+ toast.error(t(`github.installResult.error.${error}` as any));
+ } else if (error) toast.error(t('github.installResult.error.unknown', { code: error }));
+
+ // An installation that reached the callback without our state (started
+ // on github.com) is not bound until the user confirms it here. `pending`
+ // is the single-use claim that callback minted, not an installation id;
+ // the server only issues one for an installation this user does not
+ // already have, so a connected account never reaches this dialog.
+ if (pending) {
+ confirmModal({
+ cancelText: t('cancel', { ns: 'common' }),
+ content: t('github.pending.content', { account: account ?? '' }),
+ okText: t('github.pending.confirm'),
+ onOk: async () => {
+ try {
+ const bound = await scmService.connectInstallation({ claim: pending });
+ toast.success(t('github.installResult.success', { account: bound.accountLogin }));
+ data.mutate();
+ } catch {
+ toast.error(t('github.pending.failed'));
+ }
+ },
+ title: t('github.pending.title'),
+ });
+ }
+
+ for (const key of ['installed', 'error', 'account', 'pending']) url.searchParams.delete(key);
+ window.history.replaceState({}, '', url.pathname + (url.search ? `?${url.searchParams}` : ''));
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [t, ready]);
+
+ if (data.error && data.isInitialLoading) {
+ return <AsyncError error={data.error} variant={'block'} onRetry={data.mutate} />;
+ }
+
+ const { config, identity, installations } = data;
+ const installHref =
+ config?.enabled && config.installPath
+ ? buildGithubInstallHref(config.installPath, { appOrigin, workspaceId, workspaceSlug })
+ : undefined;
+
+ const first = installations.at(-1);
+ const BrandIcon = GITHUB_INTEGRATION.icon;
+
+ return (
+ <Flexbox gap={24}>
+ <span className={styles.back} onClick={onBack}>
+ <Icon icon={ArrowLeftIcon} size="small" />
+ <Text type="secondary">{t('overview.title')}</Text>
+ </span>
+
+ <Flexbox horizontal align="center" gap={16}>
+ <span className={styles.hero}>
+ <BrandIcon size={32} />
+ </span>
+ <Flexbox flex={1} gap={2} style={{ minWidth: 0 }}>
+ <Text strong style={{ fontSize: 20 }}>
+ {GITHUB_INTEGRATION.name}
+ </Text>
+ <Text type="secondary">{t('github.tagline')}</Text>
+ </Flexbox>
+ <a
+ className={styles.docs}
+ href={GITHUB_INTEGRATION.docsUrl}
+ rel="noreferrer"
+ target="_blank"
+ >
+ <Icon icon={BookOpenIcon} size="small" />
+ <Text style={{ fontSize: 13 }} type="secondary">
+ {t('github.info.docsLink')}
+ </Text>
+ </a>
+ </Flexbox>
+
+ {scope === 'workspace' && !data.isInitialLoading ? (
+ <Block className={styles.infoBar} variant={'filled'}>
+ <Flexbox horizontal align="center" gap={32} wrap="wrap">
+ {first ? (
+ <Flexbox horizontal align="center" gap={10}>
+ <Avatar
+ avatar={identity?.avatarUrl ?? first.metadata.accountAvatarUrl ?? undefined}
+ size={24}
+ title={first.installedByExternalLogin ?? first.accountLogin}
+ />
+ <Flexbox gap={1}>
+ <span className={styles.infoLabel}>{t('github.info.enabledBy')}</span>
+ <Text style={{ fontSize: 13 }}>
+ {first.installedByExternalLogin ?? first.accountLogin} ·{' '}
+ {new Date(first.createdAt).toLocaleDateString()}
+ </Text>
+ </Flexbox>
+ </Flexbox>
+ ) : (
+ <Flexbox gap={1}>
+ <span className={styles.infoLabel}>{t('github.info.status')}</span>
+ <Text style={{ fontSize: 13 }}>
+ {config?.enabled ? t('github.info.notConnected') : t('github.info.notConfigured')}
+ </Text>
+ </Flexbox>
+ )}
+ </Flexbox>
+ </Block>
+ ) : null}
+
+ {data.isInitialLoading ? (
+ <Skeleton height={96} />
+ ) : (
+ <Connections
+ configured={!!config?.enabled}
+ installHref={installHref}
+ installations={installations}
+ scope={scope}
+ />
+ )}
+
+ <Automation />
+ </Flexbox>
+ );
+});
+
+GithubIntegration.displayName = 'GithubIntegration';
+
+export default GithubIntegration;
diff --git a/src/features/Integrations/Github/installHref.test.ts b/src/features/Integrations/Github/installHref.test.ts
new file mode 100644
index 00000000000..f6f3abe32c7
--- /dev/null
+++ b/src/features/Integrations/Github/installHref.test.ts
@@ -0,0 +1,39 @@
+import { describe, expect, it } from 'vitest';
+
+import { buildGithubInstallHref } from './installHref';
+
+const INSTALL_PATH = '/api/webhooks/github/install';
+const ORIGIN = 'https://app.lobehub.com';
+
+describe('buildGithubInstallHref', () => {
+ it('returns undefined until the app origin is known', () => {
+ expect(buildGithubInstallHref(INSTALL_PATH, { workspaceId: null, workspaceSlug: null })).toBe(
+ undefined,
+ );
+ });
+
+ it('returns to the personal page outside a workspace, with no scope in the query', () => {
+ const href = buildGithubInstallHref(INSTALL_PATH, {
+ appOrigin: ORIGIN,
+ workspaceId: null,
+ workspaceSlug: null,
+ });
+
+ const url = new URL(href!);
+ expect(url.pathname).toBe(INSTALL_PATH);
+ expect(url.searchParams.get('returnTo')).toBe('/settings/integrations/github');
+ expect(url.searchParams.get('workspaceId')).toBe(null);
+ });
+
+ it('carries the workspace id so the callback binds into the workspace, not the personal scope', () => {
+ const href = buildGithubInstallHref(INSTALL_PATH, {
+ appOrigin: ORIGIN,
+ workspaceId: 'ws_123',
+ workspaceSlug: 'acme',
+ });
+
+ const url = new URL(href!);
+ expect(url.searchParams.get('workspaceId')).toBe('ws_123');
+ expect(url.searchParams.get('returnTo')).toBe('/acme/settings/integrations/github');
+ });
+});
diff --git a/src/features/Integrations/Github/installHref.ts b/src/features/Integrations/Github/installHref.ts
new file mode 100644
index 00000000000..3d5008958c9
--- /dev/null
+++ b/src/features/Integrations/Github/installHref.ts
@@ -0,0 +1,36 @@
+import urlJoin from 'url-join';
+
+/** Where the install callback sends the user back to. */
+export const GITHUB_RETURN_TO = '/settings/integrations/github';
+
+interface GithubInstallHrefParams {
+ /** Absolute origin of the LobeHub server that owns the install route. */
+ appOrigin?: string;
+ /** `null` outside a workspace; the id the installation should bind to inside one. */
+ workspaceId?: string | null;
+ /** `null` outside a workspace; the slug the return path is mirrored under. */
+ workspaceSlug?: string | null;
+}
+
+/**
+ * The "Connect GitHub" target. Absolute on purpose: on desktop the renderer
+ * lives on app://renderer and a relative link never reaches the server route.
+ *
+ * Both workspace facts travel in the query because this is a full-page
+ * navigation, not a TRPC call: without `workspaceId` the callback binds the
+ * installation to the installer's personal scope, and without the mirrored
+ * `returnTo` the user lands back on the personal surface.
+ */
+export const buildGithubInstallHref = (
+ installPath: string,
+ { appOrigin, workspaceId, workspaceSlug }: GithubInstallHrefParams,
+): string | undefined => {
+ if (!appOrigin) return undefined;
+
+ const query = new URLSearchParams({
+ returnTo: workspaceSlug ? `/${workspaceSlug}${GITHUB_RETURN_TO}` : GITHUB_RETURN_TO,
+ });
+ if (workspaceId) query.set('workspaceId', workspaceId);
+
+ return `${urlJoin(appOrigin, installPath)}?${query}`;
+};
diff --git a/src/features/Integrations/IntegrationCard.tsx b/src/features/Integrations/IntegrationCard.tsx
new file mode 100644
index 00000000000..835ceaf4583
--- /dev/null
+++ b/src/features/Integrations/IntegrationCard.tsx
@@ -0,0 +1,158 @@
+'use client';
+
+import { Block, Flexbox } from '@lobehub/ui';
+import { Text } from '@lobehub/ui/base-ui';
+import { createStaticStyles, cx } from 'antd-style';
+import { type KeyboardEvent, memo } from 'react';
+import { useTranslation } from 'react-i18next';
+
+import type { IntegrationDefinition, UpcomingIntegration } from './registry';
+
+const styles = createStaticStyles(({ css, cssVar }) => ({
+ card: css`
+ padding-block: 14px;
+ padding-inline: 16px;
+ border-radius: ${cssVar.borderRadiusLG};
+
+ background: ${cssVar.colorFillQuaternary};
+
+ transition:
+ background 0.2s ease,
+ border-color 0.2s ease;
+ `,
+ compact: css`
+ padding-block: 12px;
+ `,
+ dot: css`
+ display: inline-block;
+ flex: none;
+
+ width: 6px;
+ height: 6px;
+ border-radius: 50%;
+
+ background: ${cssVar.colorSuccess};
+ `,
+ icon: css`
+ display: flex;
+ flex: none;
+ align-items: center;
+ justify-content: center;
+
+ width: 40px;
+ height: 40px;
+ border-radius: ${cssVar.borderRadius};
+
+ color: ${cssVar.colorText};
+
+ background: ${cssVar.colorFillTertiary};
+ `,
+ openable: css`
+ cursor: pointer;
+
+ &:hover {
+ border-color: ${cssVar.colorBorder};
+ background: ${cssVar.colorFillSecondary};
+ }
+
+ &:focus-visible {
+ outline: 2px solid ${cssVar.colorPrimaryBorderHover};
+ outline-offset: 2px;
+ }
+ `,
+ upcoming: css`
+ color: ${cssVar.colorTextTertiary};
+ background: ${cssVar.colorFillQuaternary};
+ `,
+ upcomingCard: css`
+ padding-block: 10px;
+ padding-inline: 14px;
+ `,
+}));
+
+type CardIntegration = IntegrationDefinition | UpcomingIntegration;
+
+interface IntegrationCardProps {
+ /** Shorter card for the Enabled strip: name plus status, no description. */
+ compact?: boolean;
+ enabled?: boolean;
+ integration: CardIntegration;
+ /** Absent for an upcoming integration, which has no page to open. */
+ onOpen?: (id: IntegrationDefinition['id']) => void;
+ /** Roadmap hint: rendered muted, not openable, labelled "Coming soon". */
+ upcoming?: boolean;
+}
+
+const IntegrationCard = memo<IntegrationCardProps>(
+ ({ compact, enabled, integration, onOpen, upcoming }) => {
+ const { t } = useTranslation('integration');
+ const Icon = integration.icon;
+ const openable = !upcoming && !!onOpen;
+ const open = () => onOpen?.(integration.id as IntegrationDefinition['id']);
+
+ const statusLabel = upcoming
+ ? t('overview.status.comingSoon')
+ : enabled
+ ? t('overview.status.enabled')
+ : t('overview.status.notConnected');
+
+ const tagline = upcoming
+ ? t(`upcoming.${integration.id}.tagline` as any)
+ : t(`${integration.id}.tagline` as any);
+
+ return (
+ <Block
+ role={openable ? 'button' : undefined}
+ // `role="button"` alone leaves the card unreachable: it has to take
+ // focus and answer Enter / Space the way a real button does.
+ tabIndex={openable ? 0 : undefined}
+ variant={'filled'}
+ className={cx(
+ styles.card,
+ compact && styles.compact,
+ upcoming && styles.upcomingCard,
+ openable && styles.openable,
+ )}
+ onClick={openable ? open : undefined}
+ onKeyDown={
+ openable
+ ? (event: KeyboardEvent<HTMLDivElement>) => {
+ if (event.key !== 'Enter' && event.key !== ' ') return;
+ event.preventDefault();
+ open();
+ }
+ : undefined
+ }
+ >
+ <Flexbox horizontal align="center" gap={14}>
+ <span
+ className={cx(styles.icon, upcoming && styles.upcoming)}
+ style={upcoming ? { height: 32, width: 32 } : undefined}
+ >
+ <Icon size={upcoming ? 18 : 24} />
+ </span>
+ <Flexbox flex={1} gap={2} style={{ minWidth: 0 }}>
+ <Text strong style={{ fontSize: 15 }} type={upcoming ? 'secondary' : undefined}>
+ {integration.name}
+ </Text>
+ {compact ? null : (
+ <Text style={{ fontSize: 13 }} type="secondary">
+ {tagline}
+ </Text>
+ )}
+ </Flexbox>
+ <Flexbox horizontal align="center" gap={6} style={{ flex: 'none' }}>
+ {enabled && !upcoming ? <span className={styles.dot} /> : null}
+ <Text style={{ fontSize: 13 }} type="secondary">
+ {statusLabel}
+ </Text>
+ </Flexbox>
+ </Flexbox>
+ </Block>
+ );
+ },
+);
+
+IntegrationCard.displayName = 'IntegrationCard';
+
+export default IntegrationCard;
diff --git a/src/features/Integrations/Layout.tsx b/src/features/Integrations/Layout.tsx
new file mode 100644
index 00000000000..44cefd5d97b
--- /dev/null
+++ b/src/features/Integrations/Layout.tsx
@@ -0,0 +1,27 @@
+'use client';
+
+import { createStaticStyles } from 'antd-style';
+import { memo, type PropsWithChildren } from 'react';
+
+const styles = createStaticStyles(({ css }) => ({
+ column: css`
+ width: 100%;
+ max-width: 760px;
+ margin-inline: auto;
+ `,
+ page: css`
+ overflow-y: auto;
+ flex: 1;
+ `,
+}));
+
+/** A reading-width column: settings content wider than a paragraph reads as a dashboard. */
+const IntegrationsLayout = memo<PropsWithChildren>(({ children }) => (
+ <div className={styles.page}>
+ <div className={styles.column}>{children}</div>
+ </div>
+));
+
+IntegrationsLayout.displayName = 'IntegrationsLayout';
+
+export default IntegrationsLayout;
diff --git a/src/features/Integrations/Overview.tsx b/src/features/Integrations/Overview.tsx
new file mode 100644
index 00000000000..396ad4d47b1
--- /dev/null
+++ b/src/features/Integrations/Overview.tsx
@@ -0,0 +1,103 @@
+'use client';
+
+import { Flexbox } from '@lobehub/ui';
+import { createStaticStyles } from 'antd-style';
+import { memo } from 'react';
+import { useTranslation } from 'react-i18next';
+
+import IntegrationCard from './IntegrationCard';
+import { type IntegrationId, INTEGRATIONS, UPCOMING_INTEGRATIONS } from './registry';
+import { useGithubIntegration } from './useGithubIntegration';
+
+const styles = createStaticStyles(({ css, cssVar }) => ({
+ list: css`
+ display: grid;
+ grid-template-columns: 1fr;
+ gap: 10px;
+ `,
+ sectionLabel: css`
+ font-size: 12px;
+ font-weight: 500;
+ color: ${cssVar.colorTextTertiary};
+ text-transform: uppercase;
+ letter-spacing: 0.06em;
+ `,
+ strip: css`
+ display: grid;
+ grid-template-columns: repeat(3, 1fr);
+ gap: 10px;
+
+ @media (width <= 720px) {
+ grid-template-columns: 1fr;
+ }
+ `,
+ upcoming: css`
+ display: grid;
+ grid-template-columns: repeat(2, 1fr);
+ gap: 8px;
+
+ @media (width <= 720px) {
+ grid-template-columns: 1fr;
+ }
+ `,
+}));
+
+interface OverviewProps {
+ onOpen: (id: IntegrationId) => void;
+}
+
+/**
+ * The integrations directory: the integrations already connected in this
+ * scope, everything available, and what is on the roadmap. Connection state
+ * per integration comes from that integration's own hook so the list stays
+ * a static registry.
+ */
+const Overview = memo<OverviewProps>(({ onOpen }) => {
+ const { t } = useTranslation('integration');
+ const github = useGithubIntegration();
+
+ const enabledById: Record<IntegrationId, boolean> = { github: github.enabled };
+ const enabled = INTEGRATIONS.filter((item) => enabledById[item.id]);
+
+ return (
+ <Flexbox gap={24}>
+ {enabled.length > 0 ? (
+ <Flexbox gap={10}>
+ <span className={styles.sectionLabel}>{t('overview.enabled')}</span>
+ <div className={styles.strip}>
+ {enabled.map((item) => (
+ <IntegrationCard compact enabled integration={item} key={item.id} onOpen={onOpen} />
+ ))}
+ </div>
+ </Flexbox>
+ ) : null}
+
+ <Flexbox gap={10}>
+ <span className={styles.sectionLabel}>{t('overview.all')}</span>
+ <div className={styles.list}>
+ {INTEGRATIONS.map((item) => (
+ <IntegrationCard
+ enabled={enabledById[item.id]}
+ integration={item}
+ key={item.id}
+ onOpen={onOpen}
+ />
+ ))}
+ </div>
+ </Flexbox>
+
+ <Flexbox gap={10}>
+ <span className={styles.sectionLabel}>{t('overview.comingSoon')}</span>
+ <div className={styles.upcoming}>
+ {UPCOMING_INTEGRATIONS.map((item) => (
+ <IntegrationCard upcoming integration={item} key={item.id} />
+ ))}
+ </div>
+ </Flexbox>
+ </Flexbox>
+ );
+});
+
+Overview.displayName = 'IntegrationsOverview';
+
+export default Overview;
diff --git a/src/features/Integrations/index.tsx b/src/features/Integrations/index.tsx
new file mode 100644
index 00000000000..990b94ee678
--- /dev/null
+++ b/src/features/Integrations/index.tsx
@@ -0,0 +1,43 @@
+'use client';
+
+import './Github/definition';
+
+import { memo, useEffect } from 'react';
+import { useParams } from 'react-router';
+
+import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';
+
+import GithubIntegration from './Github';
+import IntegrationsLayout from './Layout';
+import Overview from './Overview';
+import { type IntegrationId, isIntegrationId } from './registry';
+
+const BASE_PATH = '/settings/integrations';
+
+/**
+ * Settings → Integrations. The bare path is the directory; a known
+ * sub-segment opens that integration's page, an unknown one is replaced by
+ * the directory so stale deep links degrade gracefully.
+ */
+const IntegrationsSettings = memo(() => {
+ const navigate = useWorkspaceAwareNavigate();
+ const params = useParams<{ sub?: string }>();
+ const selected: IntegrationId | null = isIntegrationId(params.sub) ? params.sub : null;
+
+ useEffect(() => {
+ if (params.sub && !selected) navigate(BASE_PATH, { replace: true });
+ }, [navigate, params.sub, selected]);
+
+ const open = (id: IntegrationId) => navigate(`${BASE_PATH}/${id}`);
+ const back = () => navigate(BASE_PATH);
+
+ return (
+ <IntegrationsLayout>
+ {selected === 'github' ? <GithubIntegration onBack={back} /> : <Overview onOpen={open} />}
+ </IntegrationsLayout>
+ );
+});
+
+IntegrationsSettings.displayName = 'IntegrationsSettings';
+
+export default IntegrationsSettings;
diff --git a/src/features/Integrations/registry.test.ts b/src/features/Integrations/registry.test.ts
new file mode 100644
index 00000000000..b638587e827
--- /dev/null
+++ b/src/features/Integrations/registry.test.ts
@@ -0,0 +1,25 @@
+import './Github/definition';
+
+import { describe, expect, it } from 'vitest';
+
+import { findIntegration, INTEGRATIONS, isIntegrationId, UPCOMING_INTEGRATIONS } from './registry';
+
+describe('integrations registry', () => {
+ it('registers GitHub once, even when the definition module is evaluated again', async () => {
+ await import('./Github/definition');
+ expect(INTEGRATIONS.filter((item) => item.id === 'github')).toHaveLength(1);
+ });
+
+ it('resolves ids used as settings sub-routes', () => {
+ expect(isIntegrationId('github')).toBe(true);
+ expect(isIntegrationId('slack')).toBe(false);
+ expect(isIntegrationId(undefined)).toBe(false);
+ expect(findIntegration('github')?.name).toBe('GitHub');
+ });
+
+ it('keeps upcoming integrations out of the routable set', () => {
+ for (const item of UPCOMING_INTEGRATIONS) {
+ expect(isIntegrationId(item.id)).toBe(false);
+ }
+ });
+});
diff --git a/src/features/Integrations/registry.ts b/src/features/Integrations/registry.ts
new file mode 100644
index 00000000000..a04c0c16f75
--- /dev/null
+++ b/src/features/Integrations/registry.ts
@@ -0,0 +1,53 @@
+import { Cloudflare, Notion, Railway, Vercel } from '@lobehub/icons';
+import type { ComponentType } from 'react';
+
+/** Stable id of an integration; doubles as its settings sub-route (`/settings/integrations/<id>`). */
+export type IntegrationId = 'github';
+
+export interface IntegrationDefinition {
+ /** Documentation page for the integration. */
+ docsUrl: string;
+ /** Brand mark, rendered at the size the host passes. */
+ icon: ComponentType<{ size?: number; style?: React.CSSProperties }>;
+ id: IntegrationId;
+ /** Display name — brand names are not translated. */
+ name: string;
+}
+
+/**
+ * Every integration the settings page knows about, in display order. The
+ * page reads connection state per integration through its own hook; this
+ * list only says what exists and how to find it.
+ */
+export const INTEGRATIONS: IntegrationDefinition[] = [];
+
+export const registerIntegration = (definition: IntegrationDefinition) => {
+ if (!INTEGRATIONS.some((item) => item.id === definition.id)) INTEGRATIONS.push(definition);
+};
+
+export const findIntegration = (id: string | undefined): IntegrationDefinition | undefined =>
+ INTEGRATIONS.find((item) => item.id === id);
+
+export const isIntegrationId = (value: string | undefined): value is IntegrationId =>
+ !!value && INTEGRATIONS.some((item) => item.id === value);
+
+/**
+ * Integrations on the roadmap: shown in the directory as a hint, not
+ * openable. Chosen for the same reason GitHub came first — each is a
+ * platform that reports back on an agent's work (a failed deployment, a
+ * build error, a comment on a document) and can wake the agent with it.
+ */
+export type UpcomingIntegrationId = 'cloudflare' | 'notion' | 'railway' | 'vercel';
+
+export interface UpcomingIntegration {
+ icon: IntegrationDefinition['icon'];
+ id: UpcomingIntegrationId;
+ name: string;
+}
+
+export const UPCOMING_INTEGRATIONS: UpcomingIntegration[] = [
+ { icon: Vercel, id: 'vercel', name: 'Vercel' },
+ { icon: Railway, id: 'railway', name: 'Railway' },
+ { icon: Cloudflare, id: 'cloudflare', name: 'Cloudflare' },
+ { icon: Notion, id: 'notion', name: 'Notion' },
+];
diff --git a/src/features/Integrations/useGithubIntegration.ts b/src/features/Integrations/useGithubIntegration.ts
new file mode 100644
index 00000000000..ef4732bbb60
--- /dev/null
+++ b/src/features/Integrations/useGithubIntegration.ts
@@ -0,0 +1,34 @@
+import useSWR from 'swr';
+
+import { scmKeys } from '@/libs/swr/keys';
+import { scmService } from '@/services/scm';
+
+/**
+ * Everything the GitHub integration surfaces need, fetched once and shared
+ * by the overview card and the detail page. `enabled` is "at least one live
+ * installation", which is what the overview's Enabled section keys on.
+ */
+export const useGithubIntegration = () => {
+ const config = useSWR(scmKeys.config(), () => scmService.getConfig());
+ const identity = useSWR(scmKeys.identity('github'), () => scmService.getIdentity('github'));
+ const installations = useSWR(scmKeys.installations(null), () => scmService.listInstallations());
+
+ const isInitialLoading =
+ config.data === undefined || installations.data === undefined || identity.data === undefined;
+ const error = config.error ?? installations.error ?? identity.error;
+ const mutate = () => {
+ void config.mutate();
+ void identity.mutate();
+ void installations.mutate();
+ };
+
+ return {
+ config: config.data?.github,
+ enabled: (installations.data?.length ?? 0) > 0,
+ error,
+ identity: identity.data ?? null,
+ installations: installations.data ?? [],
+ isInitialLoading,
+ mutate,
+ };
+};
diff --git a/src/features/Settings/features/componentMap.desktop.ts b/src/features/Settings/features/componentMap.desktop.ts
index 98dc3bc93a2..f25a872338a 100644
--- a/src/features/Settings/features/componentMap.desktop.ts
+++ b/src/features/Settings/features/componentMap.desktop.ts
@@ -13,6 +13,7 @@ import Connector from '../connector';
import Creds from '../creds';
import Devices from '../devices';
import Hotkey from '../hotkey';
+import Integrations from '../integrations';
import Labels from '../labels';
import Labs from '../labs';
import Memory from '../memory';
@@ -37,6 +38,7 @@ export const componentMap = {
[SettingsTabs.ServiceModel]: ServiceModel,
[SettingsTabs.Memory]: Memory,
[SettingsTabs.Messenger]: Messenger,
+ [SettingsTabs.Integrations]: Integrations,
[SettingsTabs.Notification]: DesktopNotificationSettings,
[SettingsTabs.About]: About,
[SettingsTabs.Hotkey]: Hotkey,
diff --git a/src/features/Settings/features/componentMap.ts b/src/features/Settings/features/componentMap.ts
index 29cd4c10829..a8ba0f61b7c 100644
--- a/src/features/Settings/features/componentMap.ts
+++ b/src/features/Settings/features/componentMap.ts
@@ -29,6 +29,9 @@ export const componentMap = {
[SettingsTabs.Messenger]: dynamic(() => import('../messenger'), {
loading: loading('Settings > Messenger'),
}),
+ [SettingsTabs.Integrations]: dynamic(() => import('../integrations'), {
+ loading: loading('Settings > Integrations'),
+ }),
[SettingsTabs.Notification]: dynamic(
() => import('@/business/client/BusinessSettingPages/Notification'),
{
diff --git a/src/features/Settings/hooks/useCategory.test.tsx b/src/features/Settings/hooks/useCategory.test.tsx
index d7ca62e05d1..c06ff62ca80 100644
--- a/src/features/Settings/hooks/useCategory.test.tsx
+++ b/src/features/Settings/hooks/useCategory.test.tsx
@@ -101,6 +101,20 @@ describe('settings useCategory', () => {
expect(getItemKeys()).not.toContain(SettingsTabs.OAuthApps);
});
+ it('hides Integrations by default and shows it in the Account group once the Labs flag is on', () => {
+ expect(getItemKeys()).not.toContain(SettingsTabs.Integrations);
+
+ useUserStore.setState({
+ preference: {
+ ...initialUserStoreState.preference,
+ lab: { ...initialUserStoreState.preference.lab, enableIntegrations: true },
+ },
+ });
+ const { result } = renderHook(() => useCategory(), { wrapper: createWrapper(true) });
+ const accountGroup = result.current.find((group) => group.key === SettingsGroupKey.Account);
+ expect(accountGroup?.items.map((item) => item.key)).toContain(SettingsTabs.Integrations);
+ });
+
it('shows OAuth Apps when the Labs preference is enabled', () => {
useUserStore.setState({
preference: {
diff --git a/src/features/Settings/hooks/useCategory.tsx b/src/features/Settings/hooks/useCategory.tsx
index 43d3bc619d9..721a5e404df 100644
--- a/src/features/Settings/hooks/useCategory.tsx
+++ b/src/features/Settings/hooks/useCategory.tsx
@@ -5,6 +5,7 @@ import {
AppWindowIcon,
BellIcon,
Blocks,
+ BlocksIcon,
Brain,
BrainCircuit,
ChartColumnBigIcon,
@@ -80,6 +81,7 @@ export const useCategory = () => {
const remoteServerUrl = useElectronStore(electronSyncSelectors.remoteServerUrl);
const isDevMode = useUserStore((s) => userGeneralSettingsSelectors.config(s).isDevMode);
const enableOAuthApps = useUserStore(labPreferSelectors.enableOAuthApps);
+ const enableIntegrations = useUserStore(labPreferSelectors.enableIntegrations);
const avatarUrl = useMemo(() => {
if (!avatar) return undefined;
@@ -118,6 +120,14 @@ export const useCategory = () => {
key: SettingsTabs.Messenger,
label: t('tab.messenger'),
},
+ // Third-party integrations (the GitHub App today) are bound to the user
+ // or workspace that connected them, so they sit with the account. Labs
+ // alpha: hidden until the closed loop is ready for everyone.
+ enableIntegrations && {
+ icon: BlocksIcon,
+ key: SettingsTabs.Integrations,
+ label: t('tab.integrations'),
+ },
].filter(Boolean) as CategoryItem[];
groups.push({
@@ -296,6 +306,7 @@ export const useCategory = () => {
showProvider,
isDevMode,
enableOAuthApps,
+ enableIntegrations,
avatarUrl,
username,
]);
diff --git a/src/features/Settings/integrations/index.tsx b/src/features/Settings/integrations/index.tsx
new file mode 100644
index 00000000000..6586841d4bc
--- /dev/null
+++ b/src/features/Settings/integrations/index.tsx
@@ -0,0 +1,50 @@
+import { Skeleton } from '@lobehub/ui/base-ui';
+import { createStaticStyles } from 'antd-style';
+import { useTranslation } from 'react-i18next';
+import { useParams } from 'react-router';
+
+import NotFound from '@/components/404';
+import IntegrationsSettings from '@/features/Integrations';
+import SettingHeader from '@/features/Settings/features/SettingHeader';
+import { useUserStore } from '@/store/user';
+import { labPreferSelectors, preferenceSelectors } from '@/store/user/selectors';
+
+const styles = createStaticStyles(({ css }) => ({
+ header: css`
+ width: 100%;
+ max-width: 760px;
+ margin-inline: auto;
+ `,
+}));
+
+interface PageProps {
+ showSettingHeader?: boolean;
+}
+
+const Page = ({ showSettingHeader = true }: PageProps) => {
+ const { t } = useTranslation('integration');
+ const params = useParams<{ sub?: string }>();
+ const [isPreferenceInit, enableIntegrations] = useUserStore((s) => [
+ preferenceSelectors.isPreferenceInit(s),
+ labPreferSelectors.enableIntegrations(s),
+ ]);
+ // The directory carries the page header; an integration page draws its own hero.
+ const showHeader = showSettingHeader && !params.sub;
+
+ // Labs alpha: a deep link with the flag off is a missing page, not a leak.
+ if (!isPreferenceInit) return <Skeleton.Text rows={5} />;
+ if (!enableIntegrations) return <NotFound />;
+
+ return (
+ <>
+ {showHeader && (
+ <div className={styles.header}>
+ <SettingHeader description={t('overview.description')} title={t('overview.title')} />
+ </div>
+ )}
+ <IntegrationsSettings />
+ </>
+ );
+};
+
+export default Page;
diff --git a/src/features/Settings/labs/features.ts b/src/features/Settings/labs/features.ts
index dc86d44d095..dc3397e8968 100644
--- a/src/features/Settings/labs/features.ts
+++ b/src/features/Settings/labs/features.ts
@@ -22,6 +22,7 @@ type LabFeatureI18nKey =
| 'heteroSessionImport'
| 'imessage'
| 'inputMarkdown'
+ | 'integrations'
| 'messageTextSelectionActions'
| 'oauthApps'
| 'projects'
@@ -101,6 +102,12 @@ export const LAB_FEATURES: LabFeatureItem[] = [
searchKeywords: ['oauth', 'oauth apps'],
stage: 'beta',
},
+ {
+ flag: 'enableIntegrations',
+ i18nKey: 'integrations',
+ searchKeywords: ['integrations', 'github', 'github app', 'pull request'],
+ stage: 'alpha',
+ },
{
flag: 'enableArtifactDeployment',
i18nKey: 'artifactDeployment',
diff --git a/src/features/Settings/labs/index.test.tsx b/src/features/Settings/labs/index.test.tsx
index fdc1049097e..50b7a7d0d2d 100644
--- a/src/features/Settings/labs/index.test.tsx
+++ b/src/features/Settings/labs/index.test.tsx
@@ -108,6 +108,13 @@ describe('Labs settings page', () => {
expect(screen.getByText('features.oauthApps.title')).toBeDefined();
});
+ it('renders Integrations as an alpha lab toggle', () => {
+ renderPage();
+
+ const integrations = screen.getByText('features.integrations.title');
+ expect(within(integrations).getByText('stage.alpha.label')).toBeDefined();
+ });
+
it('renders the topic acceptance (tray) lab toggle', () => {
renderPage();
diff --git a/src/features/SettingsSearch/items.ts b/src/features/SettingsSearch/items.ts
index 10845b5f823..581cb2f843f 100644
--- a/src/features/SettingsSearch/items.ts
+++ b/src/features/SettingsSearch/items.ts
@@ -78,6 +78,7 @@ export const TAB_SEARCH_EN_KEYWORDS: Partial<Record<SettingsTabs, string[]>> = {
'discord',
'wechat',
],
+ [SettingsTabs.Integrations]: ['integrations', 'github', 'pull request', 'ci', 'review', 'merge'],
[SettingsTabs.Notification]: [
'notification',
'email',
@@ -179,6 +180,7 @@ export const TAB_SEARCH_KEYWORDS_KEYS: Partial<Record<SettingsTabs, string>> = {
[SettingsTabs.Labs]: 'settingsSearch.tabKeywords.labs',
[SettingsTabs.Memory]: 'settingsSearch.tabKeywords.memory',
[SettingsTabs.Messenger]: 'settingsSearch.tabKeywords.messenger',
+ [SettingsTabs.Integrations]: 'settingsSearch.tabKeywords.integrations',
[SettingsTabs.Notification]: 'settingsSearch.tabKeywords.notification',
[SettingsTabs.OAuthApps]: 'settingsSearch.tabKeywords.oauthApps',
[SettingsTabs.Plans]: 'settingsSearch.tabKeywords.plans',
diff --git a/src/features/Workspace/workspaceAwarePath.ts b/src/features/Workspace/workspaceAwarePath.ts
index 554aee987af..116c1521667 100644
--- a/src/features/Workspace/workspaceAwarePath.ts
+++ b/src/features/Workspace/workspaceAwarePath.ts
@@ -51,6 +51,8 @@ export const WORKSPACE_SETTINGS_TABS: ReadonlySet<string> = new Set([
'devices',
'general',
'hotkey',
+ // Third-party integrations bind to the workspace that connected them.
+ 'integrations',
'labels',
'labs',
'members',
diff --git a/src/features/WorkspaceSetting/Layout.tsx b/src/features/WorkspaceSetting/Layout.tsx
index 19d770ababb..b06c7bc37ec 100644
--- a/src/features/WorkspaceSetting/Layout.tsx
+++ b/src/features/WorkspaceSetting/Layout.tsx
@@ -24,6 +24,7 @@ const COMPACT_HEADER_TABS = new Set<string>([
WorkspaceSettingsTabs.Devices,
WorkspaceSettingsTabs.General,
WorkspaceSettingsTabs.Hotkey,
+ WorkspaceSettingsTabs.Integrations,
WorkspaceSettingsTabs.Labels,
WorkspaceSettingsTabs.Labs,
WorkspaceSettingsTabs.Members,
diff --git a/src/features/WorkspaceSetting/hooks/useCategory.test.tsx b/src/features/WorkspaceSetting/hooks/useCategory.test.tsx
index 6a05f13bb7c..0021097a48d 100644
--- a/src/features/WorkspaceSetting/hooks/useCategory.test.tsx
+++ b/src/features/WorkspaceSetting/hooks/useCategory.test.tsx
@@ -218,4 +218,23 @@ describe('workspace settings useCategory', () => {
expect(itemKeys).toContain(WorkspaceSettingsTabs.Plans);
expect(itemKeys).toContain(WorkspaceSettingsTabs.Usage);
});
+
+ it('hides Integrations until the Labs flag is on, then lists it with the account tabs', () => {
+ expect(getItemKeys()).not.toContain(WorkspaceSettingsTabs.Integrations);
+
+ useUserStore.setState({
+ preference: {
+ ...initialUserStoreState.preference,
+ lab: { ...initialUserStoreState.preference.lab, enableIntegrations: true },
+ },
+ });
+ const { result } = renderHook(() => useWorkspaceSettingCategory(), { wrapper });
+ const accountGroup = result.current.find(
+ (group) => group.key === WorkspaceSettingsGroupKey.Account,
+ );
+
+ expect(accountGroup?.items.map((item) => item.key)).toContain(
+ WorkspaceSettingsTabs.Integrations,
+ );
+ });
});
diff --git a/src/features/WorkspaceSetting/hooks/useCategory.tsx b/src/features/WorkspaceSetting/hooks/useCategory.tsx
index 605e80a82ea..72cf80e3cc2 100644
--- a/src/features/WorkspaceSetting/hooks/useCategory.tsx
+++ b/src/features/WorkspaceSetting/hooks/useCategory.tsx
@@ -5,6 +5,7 @@ import {
AppWindowIcon,
BellIcon,
Blocks,
+ BlocksIcon,
Brain,
Building2,
ChartColumnBigIcon,
@@ -73,6 +74,7 @@ export const useWorkspaceSettingCategory = (): WorkspaceSettingCategoryGroup[] =
// immediately 403s.
const { allowed: canCreateContent } = usePermission('create_content');
const enableOAuthApps = useUserStore(labPreferSelectors.enableOAuthApps);
+ const enableIntegrations = useUserStore(labPreferSelectors.enableIntegrations);
const { hideDocs } = useServerConfigStore(featureFlagsSelectors);
const [avatar, username] = useUserStore((s) => [
userProfileSelectors.userAvatar(s),
@@ -124,6 +126,18 @@ export const useWorkspaceSettingCategory = (): WorkspaceSettingCategoryGroup[] =
key: WorkspaceSettingsTabs.Messenger,
label: t('tab.messenger'),
},
+ // An installation connected here belongs to the workspace, so
+ // every member sees the same one. Labs alpha, like the personal
+ // surface.
+ ...(enableIntegrations
+ ? [
+ {
+ icon: BlocksIcon,
+ key: WorkspaceSettingsTabs.Integrations,
+ label: t('tab.integrations'),
+ },
+ ]
+ : []),
],
key: WorkspaceSettingsGroupKey.Account,
title: t('group.profile'),
@@ -305,6 +319,7 @@ export const useWorkspaceSettingCategory = (): WorkspaceSettingCategoryGroup[] =
tLabs,
tSubscription,
enableOAuthApps,
+ enableIntegrations,
canManageWorkspace,
canViewBilling,
canCreateContent,
diff --git a/src/libs/swr/keys.ts b/src/libs/swr/keys.ts
index 99528646697..42e4539cb0c 100644
--- a/src/libs/swr/keys.ts
+++ b/src/libs/swr/keys.ts
@@ -1095,6 +1095,20 @@ export const messengerKeys = {
]),
};
+// ---- scm (GitHub App integration) --------------------------------------
+export const scmKeys = {
+ changeRequests: def('scm:changeRequests', (workspaceId: string | null | undefined) => [
+ 'scm:changeRequests',
+ workspaceId ?? null,
+ ]),
+ config: def('scm:config', () => ['scm:config']),
+ identity: def('scm:identity', (provider: string) => ['scm:identity', provider]),
+ installations: def('scm:installations', (workspaceId: string | null | undefined) => [
+ 'scm:installations',
+ workspaceId ?? null,
+ ]),
+};
+
// ---- verify (deliverable judging) ---------------------------------------
export const expertiseKeys = {
domain: def('expertise:domain', (domainId: string) => ['expertise:domain', domainId]),
@@ -1512,6 +1526,7 @@ export const swrKeys = {
localFile: localFileKeys,
message: messageKeys,
messenger: messengerKeys,
+ scm: scmKeys,
notebook: notebookSWRKeys,
ollama: ollamaKeys,
onboarding: onboardingKeys,
diff --git a/src/routes/(main)/[workspaceSlug]/settings/integrations/index.tsx b/src/routes/(main)/[workspaceSlug]/settings/integrations/index.tsx
new file mode 100644
index 00000000000..f4165adaf49
--- /dev/null
+++ b/src/routes/(main)/[workspaceSlug]/settings/integrations/index.tsx
@@ -0,0 +1,17 @@
+'use client';
+
+import IntegrationsSetting from '@/features/Settings/integrations';
+
+/**
+ * Third-party integrations mirrored under
+ * `/:workspaceSlug/settings/integrations[/:sub]`. An installation connected
+ * here binds to the workspace, so members share it; the workspace shell
+ * renders the compact header, so the page header is hidden. The integration
+ * detail level reads `sub` via `useParams` inside the feature, exactly as
+ * the personal route does.
+ */
+const WorkspaceIntegrationsSetting = () => <IntegrationsSetting showSettingHeader={false} />;
+
+WorkspaceIntegrationsSetting.displayName = 'WorkspaceIntegrationsSetting';
+
+export default WorkspaceIntegrationsSetting;
diff --git a/src/services/scm.ts b/src/services/scm.ts
new file mode 100644
index 00000000000..771d793b51f
--- /dev/null
+++ b/src/services/scm.ts
@@ -0,0 +1,18 @@
+import { lambdaClient } from '@/libs/trpc/client';
+
+class ScmService {
+ /** Redeem the single-use claim the install callback handed to the page. */
+ connectInstallation = async (params: { claim: string }) =>
+ lambdaClient.scm.connectInstallation.mutate(params);
+
+ getConfig = async () => lambdaClient.scm.getConfig.query();
+
+ getIdentity = async (provider: 'github') => lambdaClient.scm.getIdentity.query({ provider });
+
+ listChangeRequests = async (params?: { limit?: number }) =>
+ lambdaClient.scm.listChangeRequests.query(params);
+
+ listInstallations = async () => lambdaClient.scm.listInstallations.query();
+}
+
+export const scmService = new ScmService();
diff --git a/src/spa/router/desktopRouter.shared.tsx b/src/spa/router/desktopRouter.shared.tsx
index 9754e801047..02977957cef 100644
--- a/src/spa/router/desktopRouter.shared.tsx
+++ b/src/spa/router/desktopRouter.shared.tsx
@@ -1485,6 +1485,23 @@ const createMainAreaChildrenDefinition = (options: MainAreaRouteOptions = {}): R
handle: { meta: routeMeta({ Skeleton: createSurfaceSkeleton('list') }) },
path: 'messenger/:sub',
},
+ {
+ element: dynamicElement(
+ () => import('@/routes/(main)/[workspaceSlug]/settings/integrations'),
+ 'Desktop > Workspace > Settings > Integrations',
+ ),
+ handle: { meta: routeMeta({ Skeleton: createSurfaceSkeleton('list') }) },
+ path: 'integrations',
+ },
+ // Integration detail level — the page reads the integration from `sub`.
+ {
+ element: dynamicElement(
+ () => import('@/routes/(main)/[workspaceSlug]/settings/integrations'),
+ 'Desktop > Workspace > Settings > Integrations > Detail',
+ ),
+ handle: { meta: routeMeta({ Skeleton: createSurfaceSkeleton('list') }) },
+ path: 'integrations/:sub',
+ },
// Developer tools mirrored inside the workspace (user preferences).
{
element: dynamicElement(
diff --git a/src/store/global/initialState.ts b/src/store/global/initialState.ts
index e4aa9062290..77dcc8d3d42 100644
--- a/src/store/global/initialState.ts
+++ b/src/store/global/initialState.ts
@@ -76,6 +76,7 @@ export enum SettingsTabs {
Hotkey = 'hotkey',
/** @deprecated Use ServiceModel instead */
Image = 'image',
+ Integrations = 'integrations',
Labels = 'labels',
Labs = 'labs',
LLM = 'llm',
diff --git a/src/store/user/slices/preference/selectors.test.ts b/src/store/user/slices/preference/selectors.test.ts
index eace105c82a..3a43979990f 100644
--- a/src/store/user/slices/preference/selectors.test.ts
+++ b/src/store/user/slices/preference/selectors.test.ts
@@ -125,5 +125,13 @@ describe('preferenceSelectors', () => {
expect(labPreferSelectors.enableOAuthApps(store)).toBe(true);
});
+
+ it('hides Integrations unless the lab flag is on', () => {
+ store.preference.lab = undefined;
+ expect(labPreferSelectors.enableIntegrations(store)).toBe(false);
+
+ store.preference.lab = { enableIntegrations: true };
+ expect(labPreferSelectors.enableIntegrations(store)).toBe(true);
+ });
});
});
diff --git a/src/store/user/slices/preference/selectors/labPrefer.ts b/src/store/user/slices/preference/selectors/labPrefer.ts
index 24baa73f97e..4e5d365f2d7 100644
--- a/src/store/user/slices/preference/selectors/labPrefer.ts
+++ b/src/store/user/slices/preference/selectors/labPrefer.ts
@@ -18,6 +18,7 @@ export const labPreferSelectors = {
enableHeteroSessionImport: (s: UserState): boolean =>
s.preference.lab?.enableHeteroSessionImport ?? false,
enableImessage: (s: UserState): boolean => s.preference.lab?.enableImessage ?? false,
+ enableIntegrations: (s: UserState): boolean => s.preference.lab?.enableIntegrations ?? false,
enableInputMarkdown: (s: UserState): boolean =>
s.preference.lab?.enableInputMarkdown ?? DEFAULT_PREFERENCE.lab?.enableInputMarkdown ?? true,
enableMessageTextSelectionActions: (s: UserState): boolean =>
diff --git a/src/types/workspaceSettings.ts b/src/types/workspaceSettings.ts
index 0a014f56ce8..88ba10521cd 100644
--- a/src/types/workspaceSettings.ts
+++ b/src/types/workspaceSettings.ts
@@ -19,6 +19,7 @@ export enum WorkspaceSettingsTabs {
Devices = 'devices',
General = 'general',
Hotkey = 'hotkey',
+ Integrations = 'integrations',
Labels = 'labels',
Labs = 'labs',
Members = 'members',