🤯 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.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
✨ feat: support device share and optimize workspace (#16901)
Rdmclin23395fb713ffa
diff --git a/locales/ar/common.json b/locales/ar/common.jsonindex 7a145e0cbb8..e875bdf7d58 100644--- a/locales/ar/common.json+++ b/locales/ar/common.json@@ -29,8 +29,6 @@"back": "رجوع","batchDelete": "حذف جماعي","blog": "مدونة المنتج",- "botIntegrationBanner.dismiss": "إغلاق",- "botIntegrationBanner.title": "تحدث إلى Lobe AI عبر تطبيقات المراسلة المفضلة لديك","branching": "إنشاء موضوع فرعي","branchingDisable": "ميزة \"الموضوع الفرعي\" غير متاحة في الوضع الحالي. لاستخدام هذه الميزة، يرجى التبديل إلى وضع قاعدة بيانات Postgres/Pglite أو استخدام LobeHub Cloud.","branchingRequiresSavedTopic": "الموضوع الحالي غير محفوظ، يرجى حفظه أولاً لاستخدام ميزة الموضوع الفرعي",diff --git a/locales/ar/plugin.json b/locales/ar/plugin.jsonindex 3f718214d27..1cd102954df 100644--- a/locales/ar/plugin.json+++ b/locales/ar/plugin.json@@ -745,8 +745,6 @@"skillDetail.tabs.tools": "القدرات","skillDetail.tools": "الأدوات","skillDetail.trustWarning": "استخدم الموصلات فقط من المطورين الذين تثق بهم. لا تتحكم LobeHub في الأدوات التي يتيحها المطورون ولا يمكنها التحقق من أنها ستعمل كما هو متوقع أو أنها لن تتغير.",- "skillInstallBanner.dismiss": "إغلاق",- "skillInstallBanner.title": "اربط تطبيقاتك المفضلة بـ Lobe AI","store.actions.cancel": "إلغاء","store.actions.configure": "تهيئة","store.actions.confirmUninstall": "سيؤدي إلغاء التثبيت إلى مسح إعدادات المهارة. هل ترغب في المتابعة؟",diff --git a/locales/bg-BG/common.json b/locales/bg-BG/common.jsonindex 9e4edf1c905..9687841c174 100644--- a/locales/bg-BG/common.json+++ b/locales/bg-BG/common.json@@ -29,8 +29,6 @@"back": "Назад","batchDelete": "Групово изтриване","blog": "Блог на продукта",- "botIntegrationBanner.dismiss": "Затвори",- "botIntegrationBanner.title": "Говорете с Lobe AI в любимите си приложения за съобщения","branching": "Създай подтема","branchingDisable": "Функцията „Подтема“ не е налична в текущия режим. За да я използвате, превключете към режим Postgres/Pglite DB или използвайте LobeHub Cloud.","branchingRequiresSavedTopic": "Текущата тема не е запазена, моля, запазете я, за да използвате функцията за подтема",diff --git a/locales/bg-BG/plugin.json b/locales/bg-BG/plugin.jsonindex d4a8c07afbd..74b10f53f16 100644--- a/locales/bg-BG/plugin.json+++ b/locales/bg-BG/plugin.json@@ -745,8 +745,6 @@"skillDetail.tabs.tools": "Възможности","skillDetail.tools": "Инструменти","skillDetail.trustWarning": "Използвайте само конектори от разработчици, на които имате доверие. LobeHub не контролира кои инструменти са предоставени от разработчиците и не може да гарантира, че ще работят според очакванията или че няма да бъдат променени.",- "skillInstallBanner.dismiss": "Отхвърли",- "skillInstallBanner.title": "Свържете любимите си приложения с Lobe AI","store.actions.cancel": "Отказ","store.actions.configure": "Конфигурирай","store.actions.confirmUninstall": "Деинсталирането ще изчисти конфигурацията на умението. Продължите ли?",diff --git a/locales/de-DE/common.json b/locales/de-DE/common.jsonindex 85d62bf7bff..79217e80f38 100644--- a/locales/de-DE/common.json+++ b/locales/de-DE/common.json@@ -29,8 +29,6 @@"back": "Zurück","batchDelete": "Mehrfach löschen","blog": "Produkt-Blog",- "botIntegrationBanner.dismiss": "Schließen",- "botIntegrationBanner.title": "Sprich mit Lobe AI in deinen bevorzugten Messaging-Apps","branching": "Unterthema erstellen","branchingDisable": "Die Funktion „Unterthema“ ist im aktuellen Modus nicht verfügbar. Bitte wechseln Sie in den Postgres/PGlite-DB-Modus oder nutzen Sie LobeHub Cloud.","branchingRequiresSavedTopic": "Das aktuelle Thema ist nicht gespeichert. Bitte speichern Sie es zuerst, um die Unterthema-Funktion zu nutzen.",diff --git a/locales/de-DE/plugin.json b/locales/de-DE/plugin.jsonindex 28caa1cdf37..78d96596bf2 100644--- a/locales/de-DE/plugin.json+++ b/locales/de-DE/plugin.json@@ -745,8 +745,6 @@"skillDetail.tabs.tools": "Funktionen","skillDetail.tools": "Werkzeuge","skillDetail.trustWarning": "Verwenden Sie nur Connectoren von vertrauenswürdigen Entwicklern. LobeHub hat keine Kontrolle darüber, welche Werkzeuge von Entwicklern bereitgestellt werden, und kann nicht garantieren, dass diese wie beabsichtigt funktionieren oder unverändert bleiben.",- "skillInstallBanner.dismiss": "Schließen",- "skillInstallBanner.title": "Verbinde deine Lieblings-Apps mit Lobe AI","store.actions.cancel": "Abbrechen","store.actions.configure": "Konfigurieren","store.actions.confirmUninstall": "Durch Deinstallation wird die Skill-Konfiguration gelöscht. Fortfahren?",diff --git a/locales/en-US/chat.json b/locales/en-US/chat.jsonindex 834e47780d5..654b6e1c37f 100644--- a/locales/en-US/chat.json+++ b/locales/en-US/chat.json@@ -302,6 +302,7 @@"heteroAgent.executionTarget.localDesc": "Run as a local process on this desktop app","heteroAgent.executionTarget.manage": "Manage","heteroAgent.executionTarget.noDevices": "No remote devices yet. Run `lh connect` on another machine to add one.",+ "heteroAgent.executionTarget.noWorkspaceDevices": "No workspace devices yet. Run `{{cmd}}` on a machine to enroll it for every member.","heteroAgent.executionTarget.none": "No device","heteroAgent.executionTarget.noneDesc": "No device enabled","heteroAgent.executionTarget.offline": "Offline",diff --git a/locales/en-US/common.json b/locales/en-US/common.jsonindex 1b1f13f0ae5..ef9bb162b14 100644--- a/locales/en-US/common.json+++ b/locales/en-US/common.json@@ -29,8 +29,6 @@"back": "Back","batchDelete": "Batch Delete","blog": "Product Blog",- "botIntegrationBanner.dismiss": "Dismiss",- "botIntegrationBanner.title": "Create your own Bot Channel","branching": "Create Subtopic","branchingDisable": "The \"Sub-topic\" feature is unavailable in the current mode. To use this feature, please switch to Postgres/Pglite DB mode or use LobeHub Cloud.","branchingRequiresSavedTopic": "Current topic is not saved, please save it first to use subtopic feature",@@ -411,6 +409,7 @@"retry": "Retry","run": "Run","save": "Save",+ "saveAgentConfigFail": "Failed to save agent settings. Your change was not applied.","send": "Send","serverVersionOutdated.desc": "Your client version (v{{version}}) requires a newer server version.","serverVersionOutdated.dismiss": "Continue Anyway",@@ -507,12 +506,14 @@"userPanel.help": "Help Center","userPanel.inviteFriend": "Invite a friend","userPanel.moveGuide": "The settings button has been moved here",+ "userPanel.myUsage": "My Usage","userPanel.plans": "Subscription Plans","userPanel.profile": "Account","userPanel.setting": "Settings","userPanel.upgradePlan": "Upgrade Plan","userPanel.usages": "Usage","userPanel.workspaceSetting": "Workspace Settings",+ "userPanel.workspaceUsage": "Workspace Usage","version": "Version","visibilityConfirm.irreversible": " (irreversible)","visibilityConfirm.makePrivate.itemAccess": "Other workspace members lose access immediately",diff --git a/locales/en-US/plugin.json b/locales/en-US/plugin.jsonindex 29b1a46a905..2e2f3c78be3 100644--- a/locales/en-US/plugin.json+++ b/locales/en-US/plugin.json@@ -745,8 +745,6 @@"skillDetail.tabs.tools": "Capabilities","skillDetail.tools": "Tools","skillDetail.trustWarning": "Only use connectors from developers you trust. LobeHub does not control which tools developers make available and cannot verify that they will work as intended or that they won't change.",- "skillInstallBanner.dismiss": "Dismiss",- "skillInstallBanner.title": "Connect your favorite apps to Lobe AI","store.actions.cancel": "Cancel","store.actions.configure": "Configure","store.actions.confirmUninstall": "Uninstalling will clear Skill config. Continue?",diff --git a/locales/en-US/setting.json b/locales/en-US/setting.jsonindex dc9f1898253..01825c2fc97 100644--- a/locales/en-US/setting.json+++ b/locales/en-US/setting.json@@ -1790,6 +1790,14 @@"workspace.billingPage.plans.buyMoreSeatsCta": "Adjust seats","workspace.billingPage.plans.cancelled": "Pending cancellation","workspace.billingPage.plans.capacityOnly": "Up to {{max}} seats",+ "workspace.billingPage.plans.compare.collaborationTitle": "Collaboration & Management",+ "workspace.billingPage.plans.compare.extraSeats": "Additional seats",+ "workspace.billingPage.plans.compare.extraSeatsValue": "${{fee}} / seat / month",+ "workspace.billingPage.plans.compare.includedSeats": "Included seats",+ "workspace.billingPage.plans.compare.maxSeats": "Member capacity",+ "workspace.billingPage.plans.compare.seatsTitle": "Seats & Members",+ "workspace.billingPage.plans.compare.topUpPrice": "On-demand top-up",+ "workspace.billingPage.plans.compare.topUpPriceValue": "${{price}} / 1M credits","workspace.billingPage.plans.creditsHint": "Shared monthly pool · every seat draws from the same balance","workspace.billingPage.plans.creditsTitle": "Workspace credits","workspace.billingPage.plans.creditsTooltip": "Workspace-wide monthly credits. Adding seats does NOT grow the pool — overage flows through AutoTopUp.",diff --git a/locales/es-ES/common.json b/locales/es-ES/common.jsonindex 189eee68593..2fd826ed16b 100644--- a/locales/es-ES/common.json+++ b/locales/es-ES/common.json@@ -29,8 +29,6 @@"back": "Atrás","batchDelete": "Eliminar en lote","blog": "Blog del producto",- "botIntegrationBanner.dismiss": "Cerrar",- "botIntegrationBanner.title": "Habla con Lobe AI en tus apps de mensajería favoritas","branching": "Crear subtema","branchingDisable": "La función de \"Subtema\" no está disponible en el modo actual. Para usar esta función, cambia al modo de base de datos Postgres/PGlite o utiliza LobeHub Cloud.","branchingRequiresSavedTopic": "El tema actual no está guardado, guárdalo primero para usar la función de subtema",diff --git a/locales/es-ES/plugin.json b/locales/es-ES/plugin.jsonindex 8a2b6259d4e..6677d5b131f 100644--- a/locales/es-ES/plugin.json+++ b/locales/es-ES/plugin.json@@ -745,8 +745,6 @@"skillDetail.tabs.tools": "Capacidades","skillDetail.tools": "Herramientas","skillDetail.trustWarning": "Utiliza solo conectores de desarrolladores en los que confíes. LobeHub no controla qué herramientas ponen a disposición los desarrolladores ni puede garantizar que funcionen como se espera o que no cambien.",- "skillInstallBanner.dismiss": "Descartar",- "skillInstallBanner.title": "Conecta tus apps favoritas a Lobe AI","store.actions.cancel": "Cancelar","store.actions.configure": "Configurar","store.actions.confirmUninstall": "Desinstalar eliminará la configuración del Skill. ¿Continuar?",diff --git a/locales/fa-IR/common.json b/locales/fa-IR/common.jsonindex c684b6412b8..fc2dae2a1e8 100644--- a/locales/fa-IR/common.json+++ b/locales/fa-IR/common.json@@ -29,8 +29,6 @@"back": "بازگشت","batchDelete": "حذف گروهی","blog": "وبلاگ محصول",- "botIntegrationBanner.dismiss": "بستن",- "botIntegrationBanner.title": "با Lobe AI در پیامرسانهای مورد علاقهتان گفتگو کنید","branching": "ایجاد زیرموضوع","branchingDisable": "ویژگی «زیرموضوع» در حالت فعلی در دسترس نیست. برای استفاده از این ویژگی، لطفاً به حالت پایگاه داده Postgres/Pglite یا LobeHub Cloud تغییر دهید.","branchingRequiresSavedTopic": "موضوع فعلی ذخیره نشده است، لطفاً ابتدا آن را ذخیره کنید تا بتوانید از ویژگی زیرموضوع استفاده کنید",diff --git a/locales/fa-IR/plugin.json b/locales/fa-IR/plugin.jsonindex 7ecf610d197..07b8c67b20c 100644--- a/locales/fa-IR/plugin.json+++ b/locales/fa-IR/plugin.json@@ -745,8 +745,6 @@"skillDetail.tabs.tools": "قابلیتها","skillDetail.tools": "ابزارها","skillDetail.trustWarning": "فقط از کانکتورهایی استفاده کنید که توسط توسعهدهندگان مورد اعتماد شما ارائه شدهاند. LobeHub کنترلی بر ابزارهایی که توسعهدهندگان ارائه میدهند ندارد و نمیتواند تضمین کند که این ابزارها طبق انتظار عمل میکنند یا تغییری نخواهند کرد.",- "skillInstallBanner.dismiss": "بستن",- "skillInstallBanner.title": "برنامههای مورد علاقهتان را به Lobe AI وصل کنید","store.actions.cancel": "لغو","store.actions.configure": "پیکربندی","store.actions.confirmUninstall": "حذف مهارت باعث پاک شدن پیکربندی آن میشود. ادامه میدهید؟",diff --git a/locales/fr-FR/common.json b/locales/fr-FR/common.jsonindex a7018463124..bde63c5bb5d 100644--- a/locales/fr-FR/common.json+++ b/locales/fr-FR/common.json@@ -29,8 +29,6 @@"back": "Retour","batchDelete": "Suppression en lot","blog": "Blog produit",- "botIntegrationBanner.dismiss": "Ignorer",- "botIntegrationBanner.title": "Discutez avec Lobe AI dans vos applications de messagerie favorites","branching": "Créer un sous-sujet","branchingDisable": "La fonctionnalité \"Sous-sujet\" n'est pas disponible dans le mode actuel. Pour l'utiliser, passez en mode base de données Postgres/PGlite ou utilisez LobeHub Cloud.","branchingRequiresSavedTopic": "Le sujet actuel n'est pas enregistré, veuillez l'enregistrer d'abord pour utiliser la fonction de sous-sujet",diff --git a/locales/fr-FR/plugin.json b/locales/fr-FR/plugin.jsonindex a077228d7b7..112fbdfbec5 100644--- a/locales/fr-FR/plugin.json+++ b/locales/fr-FR/plugin.json@@ -745,8 +745,6 @@"skillDetail.tabs.tools": "Fonctionnalités","skillDetail.tools": "Outils","skillDetail.trustWarning": "N'utilisez que des connecteurs provenant de développeurs de confiance. LobeHub ne contrôle pas les outils mis à disposition par les développeurs et ne peut garantir leur bon fonctionnement ni qu'ils ne seront pas modifiés.",- "skillInstallBanner.dismiss": "Ignorer",- "skillInstallBanner.title": "Connectez vos applications favorites à Lobe AI","store.actions.cancel": "Annuler","store.actions.configure": "Configurer","store.actions.confirmUninstall": "La désinstallation effacera la configuration de la compétence. Continuer ?",diff --git a/locales/it-IT/common.json b/locales/it-IT/common.jsonindex eb679fe771c..7a62d676fb1 100644--- a/locales/it-IT/common.json+++ b/locales/it-IT/common.json@@ -29,8 +29,6 @@"back": "Indietro","batchDelete": "Eliminazione multipla","blog": "Blog del prodotto",- "botIntegrationBanner.dismiss": "Chiudi",- "botIntegrationBanner.title": "Parla con Lobe AI nelle tue app di messaggistica preferite","branching": "Crea sottotema","branchingDisable": "La funzione \"Sottotema\" non è disponibile nella modalità attuale. Per utilizzarla, passa alla modalità DB Postgres/PGlite o usa LobeHub Cloud.","branchingRequiresSavedTopic": "Il tema attuale non è salvato, salvalo prima per usare la funzione sottotema",diff --git a/locales/it-IT/plugin.json b/locales/it-IT/plugin.jsonindex 1c3c6e60663..2a5099cde53 100644--- a/locales/it-IT/plugin.json+++ b/locales/it-IT/plugin.json@@ -745,8 +745,6 @@"skillDetail.tabs.tools": "Funzionalità","skillDetail.tools": "Strumenti","skillDetail.trustWarning": "Utilizza solo connettori di sviluppatori di cui ti fidi. LobeHub non controlla quali strumenti vengano resi disponibili dagli sviluppatori e non può garantire che funzionino come previsto o che non vengano modificati.",- "skillInstallBanner.dismiss": "Chiudi",- "skillInstallBanner.title": "Collega le tue app preferite a Lobe AI","store.actions.cancel": "Annulla","store.actions.configure": "Configura","store.actions.confirmUninstall": "La disinstallazione rimuoverà la configurazione della Skill. Continuare?",diff --git a/locales/ja-JP/common.json b/locales/ja-JP/common.jsonindex 1c7d744b798..828cc60991f 100644--- a/locales/ja-JP/common.json+++ b/locales/ja-JP/common.json@@ -29,8 +29,6 @@"back": "戻る","batchDelete": "一括削除","blog": "製品ブログ",- "botIntegrationBanner.dismiss": "閉じる",- "botIntegrationBanner.title": "お気に入りのメッセージアプリで Lobe AI と会話","branching": "サブトピックを作成","branchingDisable": "現在のモードでは「サブトピック」機能は利用できません。この機能を使用するには、Postgres/Pglite DB モードに切り替えるか、LobeHub Cloud をご利用ください","branchingRequiresSavedTopic": "現在のトピックが保存されていません。保存後にサブトピック機能を使用できます",diff --git a/locales/ja-JP/plugin.json b/locales/ja-JP/plugin.jsonindex 08c359f4bff..e733a059c67 100644--- a/locales/ja-JP/plugin.json+++ b/locales/ja-JP/plugin.json@@ -745,8 +745,6 @@"skillDetail.tabs.tools": "機能","skillDetail.tools": "ツール","skillDetail.trustWarning": "信頼できる開発者のコネクタのみを使用してください。LobeHub は、開発者が提供するツールを管理しておらず、それらが意図したとおりに動作することや、変更されないことを保証できません。",- "skillInstallBanner.dismiss": "閉じる",- "skillInstallBanner.title": "お気に入りのアプリを Lobe AI に接続","store.actions.cancel": "インストールをキャンセル","store.actions.configure": "設定","store.actions.confirmUninstall": "このスキルをアンインストールすると設定も削除されます。操作を確認してください",diff --git a/locales/ko-KR/common.json b/locales/ko-KR/common.jsonindex a5b525b6285..fa8c1b452af 100644--- a/locales/ko-KR/common.json+++ b/locales/ko-KR/common.json@@ -29,8 +29,6 @@"back": "뒤로","batchDelete": "일괄 삭제","blog": "제품 블로그",- "botIntegrationBanner.dismiss": "닫기",- "botIntegrationBanner.title": "즐겨 쓰는 메신저 앱에서 Lobe AI와 대화하세요","branching": "하위 주제 생성","branchingDisable": "현재 모드에서는 '하위 주제' 기능을 사용할 수 없습니다. 이 기능을 사용하려면 Postgres/Pglite DB 모드로 전환하거나 LobeHub Cloud를 이용해 주세요","branchingRequiresSavedTopic": "현재 주제가 저장되지 않았습니다. 저장 후 하위 주제 기능을 사용할 수 있습니다",diff --git a/locales/ko-KR/plugin.json b/locales/ko-KR/plugin.jsonindex 50e9f352767..696a80e012f 100644--- a/locales/ko-KR/plugin.json+++ b/locales/ko-KR/plugin.json@@ -745,8 +745,6 @@"skillDetail.tabs.tools": "기능","skillDetail.tools": "도구","skillDetail.trustWarning": "신뢰할 수 있는 개발자의 커넥터만 사용하세요. LobeHub은 개발자가 제공하는 도구를 통제하지 않으며, 해당 도구가 의도한 대로 작동하거나 변경되지 않을 것이라는 보장을 할 수 없습니다.",- "skillInstallBanner.dismiss": "닫기",- "skillInstallBanner.title": "즐겨 쓰는 앱을 Lobe AI에 연결하세요","store.actions.cancel": "설치 취소","store.actions.configure": "구성","store.actions.confirmUninstall": "이 기능을 제거하려고 합니다. 제거 시 설정 정보도 함께 삭제됩니다. 계속하시겠습니까?",diff --git a/locales/nl-NL/common.json b/locales/nl-NL/common.jsonindex 064ff75a53f..b71395ac653 100644--- a/locales/nl-NL/common.json+++ b/locales/nl-NL/common.json@@ -29,8 +29,6 @@"back": "Terug","batchDelete": "Batch verwijderen","blog": "Productblog",- "botIntegrationBanner.dismiss": "Sluiten",- "botIntegrationBanner.title": "Praat met Lobe AI in je favoriete berichtenapps","branching": "Subonderwerp aanmaken","branchingDisable": "De functie \"Subonderwerp\" is niet beschikbaar in de huidige modus. Schakel over naar Postgres/PGlite DB-modus of gebruik LobeHub Cloud om deze functie te gebruiken.","branchingRequiresSavedTopic": "Huidig onderwerp is niet opgeslagen, sla het eerst op om subonderwerpen te kunnen gebruiken",diff --git a/locales/nl-NL/plugin.json b/locales/nl-NL/plugin.jsonindex 2fbdcae1019..5f066653d7d 100644--- a/locales/nl-NL/plugin.json+++ b/locales/nl-NL/plugin.json@@ -745,8 +745,6 @@"skillDetail.tabs.tools": "Mogelijkheden","skillDetail.tools": "Hulpmiddelen","skillDetail.trustWarning": "Gebruik alleen connectors van ontwikkelaars die je vertrouwt. LobeHub heeft geen controle over welke tools ontwikkelaars beschikbaar stellen en kan niet garanderen dat ze naar behoren werken of ongewijzigd blijven.",- "skillInstallBanner.dismiss": "Sluiten",- "skillInstallBanner.title": "Verbind je favoriete apps met Lobe AI","store.actions.cancel": "Annuleren","store.actions.configure": "Configureren","store.actions.confirmUninstall": "De Skill-configuratie wordt verwijderd bij het deïnstalleren. Doorgaan?",diff --git a/locales/pl-PL/common.json b/locales/pl-PL/common.jsonindex 8a60fcfa7e7..0cf3a6d2493 100644--- a/locales/pl-PL/common.json+++ b/locales/pl-PL/common.json@@ -29,8 +29,6 @@"back": "Wstecz","batchDelete": "Usuń zbiorczo","blog": "Blog produktu",- "botIntegrationBanner.dismiss": "Zamknij",- "botIntegrationBanner.title": "Rozmawiaj z Lobe AI w ulubionych aplikacjach do wiadomości","branching": "Utwórz podtemat","branchingDisable": "Funkcja „Podtemat” jest niedostępna w bieżącym trybie. Aby z niej skorzystać, przełącz się na tryb bazy danych Postgres/PGlite lub użyj LobeHub Cloud.","branchingRequiresSavedTopic": "Bieżący temat nie został zapisany, zapisz go najpierw, aby użyć funkcji podtematu",diff --git a/locales/pl-PL/plugin.json b/locales/pl-PL/plugin.jsonindex d6b2d05ecfc..f0a26a9c240 100644--- a/locales/pl-PL/plugin.json+++ b/locales/pl-PL/plugin.json@@ -745,8 +745,6 @@"skillDetail.tabs.tools": "Możliwości","skillDetail.tools": "Narzędzia","skillDetail.trustWarning": "Używaj konektorów tylko od zaufanych deweloperów. LobeHub nie kontroluje, jakie narzędzia są udostępniane przez deweloperów i nie może zagwarantować, że będą działać zgodnie z oczekiwaniami ani że nie ulegną zmianie.",- "skillInstallBanner.dismiss": "Zamknij",- "skillInstallBanner.title": "Połącz ulubione aplikacje z Lobe AI","store.actions.cancel": "Anuluj","store.actions.configure": "Konfiguruj","store.actions.confirmUninstall": "Odinstalowanie usunie konfigurację Umiejętności. Kontynuować?",diff --git a/locales/pt-BR/common.json b/locales/pt-BR/common.jsonindex 1a5d9520080..a0b7f4a9340 100644--- a/locales/pt-BR/common.json+++ b/locales/pt-BR/common.json@@ -29,8 +29,6 @@"back": "Voltar","batchDelete": "Excluir em Lote","blog": "Blog do Produto",- "botIntegrationBanner.dismiss": "Fechar",- "botIntegrationBanner.title": "Converse com o Lobe AI nos seus apps de mensagens favoritos","branching": "Criar Subtópico","branchingDisable": "O recurso \"Subtópico\" não está disponível no modo atual. Para usá-lo, alterne para o modo de banco de dados Postgres/PGlite ou utilize o LobeHub Cloud.","branchingRequiresSavedTopic": "O tópico atual não está salvo, salve-o primeiro para usar o recurso de subtópico",diff --git a/locales/pt-BR/plugin.json b/locales/pt-BR/plugin.jsonindex 5361538baa2..31f5e317ecc 100644--- a/locales/pt-BR/plugin.json+++ b/locales/pt-BR/plugin.json@@ -745,8 +745,6 @@"skillDetail.tabs.tools": "Capacidades","skillDetail.tools": "Ferramentas","skillDetail.trustWarning": "Use apenas conectores de desenvolvedores confiáveis. O LobeHub não controla quais ferramentas os desenvolvedores disponibilizam e não pode garantir que funcionarão conforme o esperado ou que não serão alteradas.",- "skillInstallBanner.dismiss": "Dispensar",- "skillInstallBanner.title": "Conecte seus apps favoritos ao Lobe AI","store.actions.cancel": "Cancelar","store.actions.configure": "Configurar","store.actions.confirmUninstall": "Desinstalar irá apagar a configuração da habilidade. Continuar?",diff --git a/locales/ru-RU/common.json b/locales/ru-RU/common.jsonindex 8e3be51b32f..58efae87e56 100644--- a/locales/ru-RU/common.json+++ b/locales/ru-RU/common.json@@ -29,8 +29,6 @@"back": "Назад","batchDelete": "Массовое удаление","blog": "Блог продукта",- "botIntegrationBanner.dismiss": "Закрыть",- "botIntegrationBanner.title": "Общайтесь с Lobe AI в любимых мессенджерах","branching": "Создать подтему","branchingDisable": "Функция «Подтема» недоступна в текущем режиме. Чтобы использовать её, переключитесь в режим базы данных Postgres/PGlite или используйте LobeHub Cloud.","branchingRequiresSavedTopic": "Текущая тема не сохранена. Сначала сохраните её, чтобы использовать функцию подтем.",diff --git a/locales/ru-RU/plugin.json b/locales/ru-RU/plugin.jsonindex c588ccc83b7..ed438a855a9 100644--- a/locales/ru-RU/plugin.json+++ b/locales/ru-RU/plugin.json@@ -745,8 +745,6 @@"skillDetail.tabs.tools": "Возможности","skillDetail.tools": "Инструменты","skillDetail.trustWarning": "Используйте коннекторы только от доверенных разработчиков. LobeHub не контролирует, какие инструменты предоставляют разработчики, и не может гарантировать их работоспособность или неизменность.",- "skillInstallBanner.dismiss": "Закрыть",- "skillInstallBanner.title": "Подключите любимые приложения к Lobe AI","store.actions.cancel": "Отмена","store.actions.configure": "Настроить","store.actions.confirmUninstall": "Удаление очистит настройки навыка. Продолжить?",diff --git a/locales/tr-TR/common.json b/locales/tr-TR/common.jsonindex 9def4d00166..23661d35ed3 100644--- a/locales/tr-TR/common.json+++ b/locales/tr-TR/common.json@@ -29,8 +29,6 @@"back": "Geri","batchDelete": "Toplu Sil","blog": "Ürün Blogu",- "botIntegrationBanner.dismiss": "Kapat",- "botIntegrationBanner.title": "Favori mesajlaşma uygulamalarınızda Lobe AI ile konuşun","branching": "Alt Konu Oluştur","branchingDisable": "\"Alt Konu\" özelliği mevcut modda kullanılamaz. Bu özelliği kullanmak için lütfen Postgres/Pglite DB moduna geçin veya LobeHub Cloud'u kullanın.","branchingRequiresSavedTopic": "Geçerli konu kaydedilmedi, alt konu özelliğini kullanmak için lütfen önce kaydedin",diff --git a/locales/tr-TR/plugin.json b/locales/tr-TR/plugin.jsonindex 3515f178cda..51aff168c17 100644--- a/locales/tr-TR/plugin.json+++ b/locales/tr-TR/plugin.json@@ -745,8 +745,6 @@"skillDetail.tabs.tools": "Yetenekler","skillDetail.tools": "Araçlar","skillDetail.trustWarning": "Yalnızca güvendiğiniz geliştiricilerin bağlayıcılarını kullanın. LobeHub, geliştiricilerin hangi araçları sunduğunu kontrol etmez ve bu araçların beklendiği gibi çalışacağını veya değişmeyeceğini garanti edemez.",- "skillInstallBanner.dismiss": "Kapat",- "skillInstallBanner.title": "Favori uygulamalarınızı Lobe AI'a bağlayın","store.actions.cancel": "İptal","store.actions.configure": "Yapılandır","store.actions.confirmUninstall": "Skill yapılandırması silinecek. Devam edilsin mi?",diff --git a/locales/vi-VN/common.json b/locales/vi-VN/common.jsonindex a56f8b07619..1c6ec87df1b 100644--- a/locales/vi-VN/common.json+++ b/locales/vi-VN/common.json@@ -29,8 +29,6 @@"back": "Quay lại","batchDelete": "Xóa hàng loạt","blog": "Blog sản phẩm",- "botIntegrationBanner.dismiss": "Đóng",- "botIntegrationBanner.title": "Trò chuyện với Lobe AI trong các ứng dụng nhắn tin yêu thích của bạn","branching": "Tạo chủ đề phụ","branchingDisable": "Tính năng \"Chủ đề phụ\" không khả dụng trong chế độ hiện tại. Vui lòng chuyển sang chế độ cơ sở dữ liệu Postgres/Pglite hoặc sử dụng LobeHub Cloud để sử dụng tính năng này.","branchingRequiresSavedTopic": "Chủ đề hiện tại chưa được lưu, vui lòng lưu trước khi sử dụng tính năng chủ đề phụ",diff --git a/locales/vi-VN/plugin.json b/locales/vi-VN/plugin.jsonindex 9106a1d8a74..146267f2c02 100644--- a/locales/vi-VN/plugin.json+++ b/locales/vi-VN/plugin.json@@ -745,8 +745,6 @@"skillDetail.tabs.tools": "Khả năng","skillDetail.tools": "Công cụ","skillDetail.trustWarning": "Chỉ sử dụng các trình kết nối từ những nhà phát triển mà bạn tin tưởng. LobeHub không kiểm soát các công cụ mà nhà phát triển cung cấp và không thể đảm bảo rằng chúng sẽ hoạt động như mong đợi hoặc không bị thay đổi.",- "skillInstallBanner.dismiss": "Bỏ qua",- "skillInstallBanner.title": "Kết nối các ứng dụng yêu thích của bạn với Lobe AI","store.actions.cancel": "Hủy","store.actions.configure": "Cấu hình","store.actions.confirmUninstall": "Gỡ cài đặt sẽ xóa cấu hình Kỹ năng. Tiếp tục?",diff --git a/locales/zh-CN/chat.json b/locales/zh-CN/chat.jsonindex a224f4e231f..e34b8418ee0 100644--- a/locales/zh-CN/chat.json+++ b/locales/zh-CN/chat.json@@ -302,6 +302,7 @@"heteroAgent.executionTarget.localDesc": "在当前桌面端以本地进程运行","heteroAgent.executionTarget.manage": "管理","heteroAgent.executionTarget.noDevices": "暂无远程设备。在另一台机器上执行 `lh connect` 即可接入。",+ "heteroAgent.executionTarget.noWorkspaceDevices": "暂无工作区设备。在一台机器上执行 `{{cmd}}` 即可注册,供所有成员使用。","heteroAgent.executionTarget.none": "无设备","heteroAgent.executionTarget.noneDesc": "不启用任何设备","heteroAgent.executionTarget.offline": "离线",diff --git a/locales/zh-CN/common.json b/locales/zh-CN/common.jsonindex 1542afb825e..7c1a9c27e79 100644--- a/locales/zh-CN/common.json+++ b/locales/zh-CN/common.json@@ -29,8 +29,6 @@"back": "返回","batchDelete": "批量删除","blog": "产品博客",- "botIntegrationBanner.dismiss": "关闭",- "botIntegrationBanner.title": "创建你自己的消息频道","branching": "创建子话题","branchingDisable": "「子话题」功能在当前模式下不可用。如需该功能,请切换到 Postgres/Pglite DB 模式或使用 LobeHub Cloud","branchingRequiresSavedTopic": "当前话题未保存。保存后即可使用子话题",@@ -411,6 +409,7 @@"retry": "重试","run": "运行","save": "保存",+ "saveAgentConfigFail": "助手设置保存失败,变更未生效","send": "发送","serverVersionOutdated.desc": "当前客户端版本(v{{version}})需要更新的服务端版本。","serverVersionOutdated.dismiss": "继续使用",@@ -507,12 +506,14 @@"userPanel.help": "帮助中心","userPanel.inviteFriend": "邀请好友","userPanel.moveGuide": "设置按钮搬到这里啦",+ "userPanel.myUsage": "我的用量","userPanel.plans": "订阅方案","userPanel.profile": "账户管理","userPanel.setting": "应用设置","userPanel.upgradePlan": "升级套餐","userPanel.usages": "用量","userPanel.workspaceSetting": "工作区设置",+ "userPanel.workspaceUsage": "工作区用量","version": "版本","visibilityConfirm.irreversible": "(不可逆)","visibilityConfirm.makePrivate.itemAccess": "工作区其他成员会立即失去访问权",diff --git a/locales/zh-CN/plugin.json b/locales/zh-CN/plugin.jsonindex ea6caa75656..81e8971070e 100644--- a/locales/zh-CN/plugin.json+++ b/locales/zh-CN/plugin.json@@ -745,8 +745,6 @@"skillDetail.tabs.tools": "技能功能","skillDetail.tools": "工具","skillDetail.trustWarning": "请仅使用您信任的开发者提供的连接器。LobeHub 无法控制开发者提供哪些工具,也无法验证这些工具是否按预期工作或是否会发生变化。",- "skillInstallBanner.dismiss": "关闭",- "skillInstallBanner.title": "将你的常用软件连接到 Lobe AI","store.actions.cancel": "取消安装","store.actions.configure": "配置","store.actions.confirmUninstall": "即将卸载该技能,卸载后将清除该技能配置,请确认你的操作",diff --git a/locales/zh-CN/setting.json b/locales/zh-CN/setting.jsonindex bd69c6ef8c3..2fb6101e9b0 100644--- a/locales/zh-CN/setting.json+++ b/locales/zh-CN/setting.json@@ -1790,6 +1790,14 @@"workspace.billingPage.plans.buyMoreSeatsCta": "调整席位","workspace.billingPage.plans.cancelled": "待取消","workspace.billingPage.plans.capacityOnly": "最多 {{max}} 个席位",+ "workspace.billingPage.plans.compare.collaborationTitle": "协作与管理",+ "workspace.billingPage.plans.compare.extraSeats": "额外席位",+ "workspace.billingPage.plans.compare.extraSeatsValue": "${{fee}} / 席位 / 月",+ "workspace.billingPage.plans.compare.includedSeats": "包含席位",+ "workspace.billingPage.plans.compare.maxSeats": "成员容量",+ "workspace.billingPage.plans.compare.seatsTitle": "席位与成员",+ "workspace.billingPage.plans.compare.topUpPrice": "按需充值单价",+ "workspace.billingPage.plans.compare.topUpPriceValue": "${{price}} / 1M 积分","workspace.billingPage.plans.creditsHint": "共享月度池 · 每个席位从同一余额中提取","workspace.billingPage.plans.creditsTitle": "工作区积分","workspace.billingPage.plans.creditsTooltip": "工作区范围的月度积分。添加席位不会增加积分池——超额通过自动充值处理。",diff --git a/locales/zh-TW/common.json b/locales/zh-TW/common.jsonindex 14eb81522b4..bf78be1e802 100644--- a/locales/zh-TW/common.json+++ b/locales/zh-TW/common.json@@ -29,8 +29,6 @@"back": "返回","batchDelete": "批次刪除","blog": "產品部落格",- "botIntegrationBanner.dismiss": "關閉",- "botIntegrationBanner.title": "在你喜愛的聊天應用中,與 Lobe AI 暢聊","branching": "建立子主題","branchingDisable": "「子話題」功能在目前模式下無法使用,如需使用此功能,請切換至 Postgres/Pglite 資料庫模式或使用 LobeHub 雲端服務","branchingRequiresSavedTopic": "當前話題未保存,保存後才可以使用子話題功能",diff --git a/locales/zh-TW/plugin.json b/locales/zh-TW/plugin.jsonindex 7d6fe674f08..67375da5e0e 100644--- a/locales/zh-TW/plugin.json+++ b/locales/zh-TW/plugin.json@@ -745,8 +745,6 @@"skillDetail.tabs.tools": "功能","skillDetail.tools": "工具","skillDetail.trustWarning": "請僅使用您信任的開發者所提供的連接器。LobeHub 無法控制開發者提供的工具內容,也無法保證其功能如預期運作,或不會發生變更。",- "skillInstallBanner.dismiss": "關閉",- "skillInstallBanner.title": "將你常用的應用連接到 Lobe AI","store.actions.cancel": "取消安裝","store.actions.configure": "設定","store.actions.confirmUninstall": "即將卸載該插件,卸載後將清除該插件配置,請確認你的操作",diff --git a/packages/database/src/models/__tests__/agent.test.ts b/packages/database/src/models/__tests__/agent.test.tsindex bf7ef01f6ff..fcd47f76f64 100644--- a/packages/database/src/models/__tests__/agent.test.ts+++ b/packages/database/src/models/__tests__/agent.test.ts@@ -10,6 +10,7 @@ import {agentsFiles,agentsKnowledgeBases,agentsToSessions,+ devices,documents,files,knowledgeBases,@@ -2314,6 +2315,122 @@ describe('AgentModel', () => {});});+ describe('updateConfig workspace device binding', () => {+ const wsId = 'device-binding-ws';++ const seedWorkspace = async () => {+ await serverDB.insert(workspaces).values({+ id: wsId,+ name: 'device-ws',+ primaryOwnerId: userId,+ slug: wsId,+ });+ await serverDB.insert(devices).values({+ deviceId: 'ws-device-1',+ identitySource: 'machine-id',+ userId,+ workspaceId: wsId,+ });+ };++ it('rejects binding a device not enrolled in the workspace', async () => {+ await seedWorkspace();+ const [agent] = await serverDB+ .insert(agents)+ .values({ userId, visibility: 'public', workspaceId: wsId } as NewAgent)+ .returning();++ const wsModel = new AgentModel(serverDB, userId, wsId);+ await expect(+ wsModel.updateConfig(agent.id, {+ agencyConfig: { boundDeviceId: 'personal-device-x', executionTarget: 'device' },+ } as any),+ ).rejects.toMatchObject({ code: 'FORBIDDEN' });+ });++ it('allows binding an enrolled workspace device', async () => {+ await seedWorkspace();+ const [agent] = await serverDB+ .insert(agents)+ .values({ userId, visibility: 'public', workspaceId: wsId } as NewAgent)+ .returning();++ const wsModel = new AgentModel(serverDB, userId, wsId);+ await wsModel.updateConfig(agent.id, {+ agencyConfig: { boundDeviceId: 'ws-device-1', executionTarget: 'device' },+ } as any);++ const result = await serverDB.query.agents.findFirst({ where: eq(agents.id, agent.id) });+ expect(result?.agencyConfig).toMatchObject({+ boundDeviceId: 'ws-device-1',+ executionTarget: 'device',+ });+ });++ it('grandfathers legacy device ids already stored on the agent', async () => {+ await seedWorkspace();+ // A stale personal-device reference left from before the agent joined the+ // workspace (the device row no longer exists at all). Client patches+ // spread the whole stored agencyConfig, so without grandfathering this+ // agent could never bind any device again.+ const [agent] = await serverDB+ .insert(agents)+ .values({+ agencyConfig: {+ boundDeviceId: 'stale-personal-device',+ executionTarget: 'local',+ workingDirByDevice: { 'stale-personal-device': '/Users/old/dir' },+ },+ userId,+ visibility: 'public',+ workspaceId: wsId,+ } as NewAgent)+ .returning();++ const wsModel = new AgentModel(serverDB, userId, wsId);+ await wsModel.updateConfig(agent.id, {+ agencyConfig: {+ boundDeviceId: 'ws-device-1',+ executionTarget: 'device',+ workingDirByDevice: { 'stale-personal-device': '/Users/old/dir' },+ },+ } as any);++ const result = await serverDB.query.agents.findFirst({ where: eq(agents.id, agent.id) });+ expect(result?.agencyConfig).toMatchObject({+ boundDeviceId: 'ws-device-1',+ executionTarget: 'device',+ });+ });++ it('still rejects a NEW non-workspace device id even alongside grandfathered ones', async () => {+ await seedWorkspace();+ const [agent] = await serverDB+ .insert(agents)+ .values({+ agencyConfig: {+ boundDeviceId: 'stale-personal-device',+ executionTarget: 'local',+ },+ userId,+ visibility: 'public',+ workspaceId: wsId,+ } as NewAgent)+ .returning();++ const wsModel = new AgentModel(serverDB, userId, wsId);+ await expect(+ wsModel.updateConfig(agent.id, {+ agencyConfig: {+ boundDeviceId: 'stale-personal-device',+ executionTarget: 'device',+ workingDirByDevice: { 'another-personal-device': '/tmp' },+ },+ } as any),+ ).rejects.toMatchObject({ code: 'FORBIDDEN' });+ });+ });+describe('updateConfig edge cases', () => {it('should return early for null data', async () => {const [agent] = await serverDBdiff --git a/packages/database/src/models/agent.ts b/packages/database/src/models/agent.tsindex 96c1174a3c6..3747e8e45db 100644--- a/packages/database/src/models/agent.ts+++ b/packages/database/src/models/agent.ts@@ -167,15 +167,24 @@ export class AgentModel {* by their owning user, so a workspace member who isn't that owner would get* a broken agent. Rejects at write time rather than at execution time.*+ * Only device ids INTRODUCED by this patch are checked — ids already present+ * in `storedConfig` are grandfathered. Client patches spread the whole stored+ * `agencyConfig` (device picker, working-dir writes), so a legacy+ * personal-device reference left from before the agent joined the workspace+ * (or before this guard existed) would otherwise poison every future save,+ * including binding a perfectly valid workspace device.+ ** No-op when `agentWorkspaceId` is null (personal agent — any device OK) or* when the patch carries no new device ids.*/private assertWorkspaceDeviceBinding = async (agentWorkspaceId: string | null,agencyConfig: PartialDeep<LobeAgentAgencyConfig> | null | undefined,+ storedConfig?: LobeAgentAgencyConfig | null,): Promise<void> => {if (!agentWorkspaceId) return;- const candidates = this.collectBoundDeviceIds(agencyConfig);+ const existing = new Set(this.collectBoundDeviceIds(storedConfig));+ const candidates = this.collectBoundDeviceIds(agencyConfig).filter((id) => !existing.has(id));if (candidates.length === 0) return;const rows = await this.db@@ -932,7 +941,11 @@ export class AgentModel {if (!agent) return;- await this.assertWorkspaceDeviceBinding(agent.workspaceId, data.agencyConfig);+ await this.assertWorkspaceDeviceBinding(+ agent.workspaceId,+ data.agencyConfig,+ agent.agencyConfig,+ );// First process the params field: undefined means delete, null means disable flagconst existingParams = agent.params ?? {};diff --git a/packages/locales/src/default/chat.ts b/packages/locales/src/default/chat.tsindex 87222ce2913..4dbad07e362 100644--- a/packages/locales/src/default/chat.ts+++ b/packages/locales/src/default/chat.ts@@ -270,6 +270,8 @@ export default {'heteroAgent.executionTarget.manage': 'Manage','heteroAgent.executionTarget.noDevices':'No remote devices yet. Run `lh connect` on another machine to add one.',+ 'heteroAgent.executionTarget.noWorkspaceDevices':+ 'No workspace devices yet. Run `{{cmd}}` on a machine to enroll it for every member.','heteroAgent.executionTarget.none': 'No device','heteroAgent.executionTarget.noneDesc': 'No device enabled','heteroAgent.executionTarget.offline': 'Offline',diff --git a/packages/locales/src/default/common.ts b/packages/locales/src/default/common.tsindex ac7c528a015..27c494dadff 100644--- a/packages/locales/src/default/common.ts+++ b/packages/locales/src/default/common.ts@@ -31,8 +31,6 @@ export default {'back': 'Back','batchDelete': 'Batch Delete','blog': 'Product Blog',- 'botIntegrationBanner.dismiss': 'Dismiss',- 'botIntegrationBanner.title': 'Create your own Bot Channel','messengerBanner.dismiss': 'Dismiss','messengerBanner.title': 'Talk to Lobe AI on your favorite messaging apps','branching': 'Create Subtopic',@@ -291,6 +289,7 @@ export default {'copy': 'Copy','copyFail': 'Copy failed','copySuccess': 'Copied',+ 'saveAgentConfigFail': 'Failed to save agent settings. Your change was not applied.','promptTransform.action': 'Refine Idea','promptTransform.actions.rewrite': 'Expand Details','promptTransform.actions.translate': 'Translate',@@ -602,12 +601,14 @@ export default {'userPanel.help': 'Help Center','userPanel.inviteFriend': 'Invite a friend','userPanel.moveGuide': 'The settings button has been moved here',+ 'userPanel.myUsage': 'My Usage','userPanel.plans': 'Subscription Plans','userPanel.profile': 'Account','userPanel.setting': 'Settings','userPanel.upgradePlan': 'Upgrade Plan','userPanel.usages': 'Usage','userPanel.workspaceSetting': 'Workspace Settings',+ 'userPanel.workspaceUsage': 'Workspace Usage','version': 'Version','zoom': 'Zoom',};diff --git a/packages/locales/src/default/plugin.ts b/packages/locales/src/default/plugin.tsindex 03c96363101..12e93436228 100644--- a/packages/locales/src/default/plugin.ts+++ b/packages/locales/src/default/plugin.ts@@ -768,8 +768,6 @@ export default {'skillDetail.tools': 'Tools','skillDetail.trustWarning':"Only use connectors from developers you trust. LobeHub does not control which tools developers make available and cannot verify that they will work as intended or that they won't change.",- 'skillInstallBanner.dismiss': 'Dismiss',- 'skillInstallBanner.title': 'Connect your favorite apps to Lobe AI','store.actions.cancel': 'Cancel','store.actions.configure': 'Configure','store.actions.confirmUninstall': 'Uninstalling will clear Skill config. Continue?',diff --git a/packages/locales/src/default/setting.ts b/packages/locales/src/default/setting.tsindex 7623561a182..121959f5e48 100644--- a/packages/locales/src/default/setting.ts+++ b/packages/locales/src/default/setting.ts@@ -1630,6 +1630,14 @@ When I am ___, I need ___'workspace.billingPage.plans.creditsTooltip':'Workspace-wide monthly credits. Adding seats does NOT grow the pool — overage flows through AutoTopUp.','workspace.billingPage.plans.capacityOnly': 'Up to {{max}} seats',+ 'workspace.billingPage.plans.compare.collaborationTitle': 'Collaboration & Management',+ 'workspace.billingPage.plans.compare.extraSeats': 'Additional seats',+ 'workspace.billingPage.plans.compare.extraSeatsValue': '${{fee}} / seat / month',+ 'workspace.billingPage.plans.compare.includedSeats': 'Included seats',+ 'workspace.billingPage.plans.compare.maxSeats': 'Member capacity',+ 'workspace.billingPage.plans.compare.seatsTitle': 'Seats & Members',+ 'workspace.billingPage.plans.compare.topUpPrice': 'On-demand top-up',+ 'workspace.billingPage.plans.compare.topUpPriceValue': '${{price}} / 1M credits','workspace.billingPage.plans.downgradeToBasicCta': 'Downgrade','workspace.billingPage.plans.headline': 'Choose a plan','workspace.billingPage.plans.basicCapacity': 'Up to 3 seats',diff --git a/src/business/client/features/User/UserPanelStatistics.tsx b/src/business/client/features/User/UserPanelStatistics.tsxnew file mode 100644index 00000000000..430ec9f6b7e--- /dev/null+++ b/src/business/client/features/User/UserPanelStatistics.tsx@@ -0,0 +1,15 @@+import DataStatistics from '@/features/User/DataStatistics';+import WorkspaceLink from '@/features/Workspace/WorkspaceLink';++/**+ * Statistics section of the user panel. Business slot: the default renders the+ * personal data statistics cards linked to the stats page; overrides may swap+ * in a context-aware statistics surface.+ */+export default function UserPanelStatistics() {+ return (+ <WorkspaceLink style={{ color: 'inherit' }} to={'/settings/stats'}>+ <DataStatistics />+ </WorkspaceLink>+ );+}diff --git a/src/features/AgentDocumentPage/RightPanel/index.tsx b/src/features/AgentDocumentPage/RightPanel/index.tsxindex 8568b0563ed..ce4d4ff4fb5 100644--- a/src/features/AgentDocumentPage/RightPanel/index.tsx+++ b/src/features/AgentDocumentPage/RightPanel/index.tsx@@ -83,10 +83,14 @@ const AgentDocumentRightPanel = memo(() => {activeAgentId ? agentByIdSelectors.getAgencyConfigById(activeAgentId)(s) : undefined,);const deviceRoutingAvailable = useIsGatewayModeEnabled(activeAgentId);+ const isWorkspaceAgent = useAgentStore((s) =>+ activeAgentId ? agentByIdSelectors.isWorkspaceAgentById(activeAgentId)(s) : false,+ );const effectiveTarget = resolveExecutionTarget(agencyConfig, {clientExecutionAvailable: isDesktop,deviceRoutingAvailable,isHetero,+ workspaceScoped: isWorkspaceAgent,});const remoteDeviceId =effectiveTarget === 'device' && agencyConfig?.boundDeviceIddiff --git a/src/features/ChatInput/ControlBar/HeteroDeviceSwitcher.tsx b/src/features/ChatInput/ControlBar/HeteroDeviceSwitcher.tsxindex b70172b9ee2..a193b48c45a 100644--- a/src/features/ChatInput/ControlBar/HeteroDeviceSwitcher.tsx+++ b/src/features/ChatInput/ControlBar/HeteroDeviceSwitcher.tsx@@ -377,6 +377,7 @@ const HeteroDeviceSwitcher = memo<HeteroDeviceSwitcherProps>(({ agentId }) => {clientExecutionAvailable: isDesktop,deviceRoutingAvailable,isHetero,+ workspaceScoped: isWorkspaceAgent,});const selectExecutionTarget = useSelectExecutionTarget(agentId);@@ -393,11 +394,6 @@ const HeteroDeviceSwitcher = memo<HeteroDeviceSwitcherProps>(({ agentId }) => {const boundDevice =executionTarget === 'device' ? devices?.find((d) => d.deviceId === boundDeviceId) : undefined;- const deviceRows = devices ?? [];- const hasNoDevices = deviceRows.length === 0;- // On web with no device, the prominent download card below replaces the small- // header link — avoid showing the same CTA twice.- const showWebDownloadCard = !isDesktop && hasNoDevices && !isLoading;// Workspace agents drop the personal section entirely — only workspace// devices are reachable to every member, so no one should see (let alone@@ -410,6 +406,18 @@ const HeteroDeviceSwitcher = memo<HeteroDeviceSwitcherProps>(({ agentId }) => {// otherwise (personal mode / OSS) the list stays flat, exactly as before.const showDeviceGroups = workspaceDevices.length > 0;+ // Empty-state accounting must use the rows the CURRENT agent can actually+ // pick (post scope filtering) — a workspace agent whose members only have+ // personal devices would otherwise render neither devices nor an empty state.+ const deviceRows = [...personalDevices, ...workspaceDevices];+ const hasNoDevices = deviceRows.length === 0;+ // On web with no device, the prominent download card below replaces the small+ // header link — avoid showing the same CTA twice. Workspace agents get the+ // enroll hint instead: downloading the desktop app wouldn't help until the+ // machine is enrolled into the workspace pool.+ const showWebDownloadCard = !isDesktop && !isWorkspaceAgent && hasNoDevices && !isLoading;+ const showWorkspaceEnrollHint = isWorkspaceAgent && hasNoDevices && !isLoading;+// Compute chiplet chipIcon: ReactNode = <Icon icon={BoxIcon} size={14} />;let chipLabel = t('heteroAgent.executionTarget.sandbox');@@ -517,7 +525,10 @@ const HeteroDeviceSwitcher = memo<HeteroDeviceSwitcherProps>(({ agentId }) => {onClick={() => void handleSelect('auto')}/>)}- {isDesktop ? (+ {/* `local` pins this machine's PERSONAL deviceId, which a workspace agent+ can never bind (the server only accepts workspace-enrolled device ids),+ so hide it there — same policy as hiding personal devices above. */}+ {isDesktop && !isWorkspaceAgent ? (<OptionRowactive={isActive('local')}desc={t('heteroAgent.executionTarget.localDesc')}@@ -559,6 +570,16 @@ const HeteroDeviceSwitcher = memo<HeteroDeviceSwitcherProps>(({ agentId }) => {{hasNoDevices && isLoading ? (<div className={styles.empty}>{t('heteroAgent.executionTarget.loading')}</div>) : null}+ {/* Workspace agent with no workspace device: personal machines are+ suppressed above, so guide the user to enroll one into the shared+ pool instead of showing a bare menu. */}+ {showWorkspaceEnrollHint ? (+ <div className={styles.empty}>+ {t('heteroAgent.executionTarget.noWorkspaceDevices', {+ cmd: `lh connect --workspace ${agentWorkspaceId}`,+ })}+ </div>+ ) : null}{/* On web with no remote device, guide the user to the desktop app (whichunlocks local execution + `lh connect`) rather than a muted dead-end. */}{showWebDownloadCard ? (@@ -582,7 +603,7 @@ const HeteroDeviceSwitcher = memo<HeteroDeviceSwitcherProps>(({ agentId }) => {<Icon className={styles.downloadCardArrow} icon={ExternalLinkIcon} size={13} /></a>) : null}- {hasNoDevices && !isLoading && isDesktop ? (+ {hasNoDevices && !isLoading && isDesktop && !isWorkspaceAgent ? (<div className={styles.empty}>{t('heteroAgent.executionTarget.noDevices')}</div>) : null}</Flexbox>diff --git a/src/features/ChatInput/ControlBar/WorkspaceControls.tsx b/src/features/ChatInput/ControlBar/WorkspaceControls.tsxindex 8d096cfb5e3..f37d8d99c42 100644--- a/src/features/ChatInput/ControlBar/WorkspaceControls.tsx+++ b/src/features/ChatInput/ControlBar/WorkspaceControls.tsx@@ -38,10 +38,12 @@ const WorkspaceControls = memo<WorkspaceControlsProps>(const isHeterogeneous = useAgentStore(agentByIdSelectors.isAgentHeterogeneousById(agentId));const agencyConfig = useAgentStore(agentByIdSelectors.getAgencyConfigById(agentId));const deviceRoutingAvailable = useIsGatewayModeEnabled(agentId);+ const isWorkspaceAgent = useAgentStore(agentByIdSelectors.isWorkspaceAgentById(agentId));const effectiveTarget = resolveExecutionTarget(agencyConfig, {clientExecutionAvailable: isDesktop,deviceRoutingAvailable,isHetero: isHeterogeneous,+ workspaceScoped: isWorkspaceAgent,});const isDeviceMode = effectiveTarget === 'device' && !!agencyConfig?.boundDeviceId;diff --git a/src/features/ChatInput/InputEditor/ActionTag/useSlashActionItems.ts b/src/features/ChatInput/InputEditor/ActionTag/useSlashActionItems.tsindex c1a3d45738f..0802888f146 100644--- a/src/features/ChatInput/InputEditor/ActionTag/useSlashActionItems.ts+++ b/src/features/ChatInput/InputEditor/ActionTag/useSlashActionItems.ts@@ -71,10 +71,14 @@ export const useSlashActionItems = (): SlashOptions['items'] => {agentId ? agentByIdSelectors.isAgentHeterogeneousById(agentId)(s) : false,);const deviceRoutingAvailable = useIsGatewayModeEnabled(agentId);+ const isWorkspaceAgent = useAgentStore((s) =>+ agentId ? agentByIdSelectors.isWorkspaceAgentById(agentId)(s) : false,+ );const effectiveTarget = resolveExecutionTarget(agencyConfig, {clientExecutionAvailable: isDesktop,deviceRoutingAvailable,isHetero,+ workspaceScoped: isWorkspaceAgent,});const isDeviceMode = effectiveTarget === 'device' && !!agencyConfig?.boundDeviceId;const remoteDeviceId = isDeviceMode ? agencyConfig.boundDeviceId : undefined;diff --git a/src/features/ChatInput/hooks/useSelectExecutionTarget.test.ts b/src/features/ChatInput/hooks/useSelectExecutionTarget.test.tsindex 7f83825fa89..38f1b977e96 100644--- a/src/features/ChatInput/hooks/useSelectExecutionTarget.test.ts+++ b/src/features/ChatInput/hooks/useSelectExecutionTarget.test.ts@@ -12,6 +12,7 @@ const testState = vi.hoisted(() => ({heterogeneousProvider?: { type: string };}| undefined,+ agentMap: {} as Record<string, { workspaceId?: string | null }>,isHetero: false,updateAgentConfigById: vi.fn(),},@@ -53,6 +54,7 @@ vi.mock('@/store/electron', () => ({describe('useSelectExecutionTarget', () => {beforeEach(() => {testState.agent.agencyConfig = undefined;+ testState.agent.agentMap = {};testState.agent.isHetero = false;testState.agent.updateAgentConfigById = vi.fn();testState.electron.gatewayDeviceInfo = undefined;@@ -128,4 +130,26 @@ describe('useSelectExecutionTarget', () => {expect(testState.agent.updateAgentConfigById).not.toHaveBeenCalled();});++ it('refuses local for a workspace agent — its personal deviceId can never pass the workspace device guard', async () => {+ testState.isDesktop = true;+ testState.electron.gatewayDeviceInfo = { deviceId: 'this-machine' };+ testState.agent.agentMap = { 'agent-id': { workspaceId: 'ws-1' } };+ const { result } = renderHook(() => useSelectExecutionTarget('agent-id'));++ await result.current('local');++ expect(testState.agent.updateAgentConfigById).not.toHaveBeenCalled();+ });++ it('still persists a device pick for a workspace agent', async () => {+ testState.agent.agentMap = { 'agent-id': { workspaceId: 'ws-1' } };+ const { result } = renderHook(() => useSelectExecutionTarget('agent-id'));++ await result.current('device', 'ws-device-1');++ expect(testState.agent.updateAgentConfigById).toHaveBeenCalledWith('agent-id', {+ agencyConfig: { boundDeviceId: 'ws-device-1', executionTarget: 'device' },+ });+ });});diff --git a/src/features/ChatInput/hooks/useSelectExecutionTarget.ts b/src/features/ChatInput/hooks/useSelectExecutionTarget.tsindex bf94b275ac2..7d0ebe4442b 100644--- a/src/features/ChatInput/hooks/useSelectExecutionTarget.ts+++ b/src/features/ChatInput/hooks/useSelectExecutionTarget.ts@@ -20,6 +20,7 @@ import { useElectronStore } from '@/store/electron';export const useSelectExecutionTarget = (agentId: string) => {const agencyConfig = useAgentStore(agentByIdSelectors.getAgencyConfigById(agentId));const isHetero = useAgentStore(agentByIdSelectors.isAgentHeterogeneousById(agentId));+ const isWorkspaceAgent = useAgentStore((s) => Boolean(s.agentMap[agentId]?.workspaceId));const updateAgentConfigById = useAgentStore((s) => s.updateAgentConfigById);// The current machine's own gateway deviceId (desktop only); used to pin a@@ -29,6 +30,13 @@ export const useSelectExecutionTarget = (agentId: string) => {return useCallback(async (target: DeviceExecutionTarget, deviceId?: string) => {+ // A workspace agent may only bind devices enrolled in the same workspace+ // (server-enforced by `assertWorkspaceDeviceBinding`). `local` pins this+ // machine's PERSONAL gateway deviceId — a different identity from its+ // workspace enrollment — so the write would always be rejected; refuse it+ // here instead of letting the save silently fail.+ if (target === 'local' && isWorkspaceAgent) return;+const boundDeviceId = agencyConfig?.boundDeviceId;let nextBoundDeviceId = target === 'device' ? deviceId : boundDeviceId;if (target === 'local') {@@ -53,6 +61,6 @@ export const useSelectExecutionTarget = (agentId: string) => {},});},- [agentId, agencyConfig, currentDeviceId, isHetero, updateAgentConfigById],+ [agentId, agencyConfig, currentDeviceId, isHetero, isWorkspaceAgent, updateAgentConfigById],);};diff --git a/src/features/Conversation/store/slices/generation/action.ts b/src/features/Conversation/store/slices/generation/action.tsindex d7d152627b9..267ea1ce8af 100644--- a/src/features/Conversation/store/slices/generation/action.ts+++ b/src/features/Conversation/store/slices/generation/action.ts@@ -388,6 +388,9 @@ export const generationSlice: StateCreator<executionTarget: agentConfig?.agencyConfig?.executionTarget,heterogeneousProvider: agentConfig?.agencyConfig?.heterogeneousProvider,isGatewayMode: chatStore.isGatewayModeEnabled(context.agentId),+ isWorkspaceAgent: agentByIdSelectors.isWorkspaceAgentById(context.agentId)(+ getAgentStoreState(),+ ),});// Hetero CLIs (CC / Codex) have no "continue a cut-off response" primitive@@ -706,6 +709,9 @@ export const generationSlice: StateCreator<executionTarget: agentConfig?.agencyConfig?.executionTarget,heterogeneousProvider,isGatewayMode: chatStore.isGatewayModeEnabled(context.agentId),+ isWorkspaceAgent: agentByIdSelectors.isWorkspaceAgentById(context.agentId)(+ getAgentStoreState(),+ ),});// ── Gateway mode: trigger server-side regeneration ──diff --git a/src/features/Conversation/store/slices/generation/regenerateHeteroImages.test.ts b/src/features/Conversation/store/slices/generation/regenerateHeteroImages.test.tsindex 778b0ba5859..f4aef130a98 100644--- a/src/features/Conversation/store/slices/generation/regenerateHeteroImages.test.ts+++ b/src/features/Conversation/store/slices/generation/regenerateHeteroImages.test.ts@@ -45,7 +45,10 @@ vi.mock('@/services/message', () => ({vi.mock('@/store/agent', () => ({ getAgentStoreState: () => ({}) }));vi.mock('@/store/agent/selectors', () => ({- agentByIdSelectors: { getAgentWorkingDirectoryById: () => () => '/work/dir' },+ agentByIdSelectors: {+ getAgentWorkingDirectoryById: () => () => '/work/dir',+ isWorkspaceAgentById: () => () => false,+ },agentSelectors: {getAgentConfigById: () => () => ({agencyConfig: {diff --git a/src/features/SkillsList/useProjectSkillResolver.ts b/src/features/SkillsList/useProjectSkillResolver.tsindex 147a194f1b9..b39fd03df0c 100644--- a/src/features/SkillsList/useProjectSkillResolver.ts+++ b/src/features/SkillsList/useProjectSkillResolver.ts@@ -50,10 +50,14 @@ export const useProjectSkillResolver = (agentId ? agentByIdSelectors.isAgentHeterogeneousById(agentId)(s) : false,);const deviceRoutingAvailable = useIsGatewayModeEnabled(agentId);+ const isWorkspaceAgent = useAgentStore((s) =>+ agentId ? agentByIdSelectors.isWorkspaceAgentById(agentId)(s) : false,+ );const effectiveTarget = resolveExecutionTarget(agencyConfig, {clientExecutionAvailable: isDesktop,deviceRoutingAvailable,isHetero,+ workspaceScoped: isWorkspaceAgent,});const isDeviceMode = effectiveTarget === 'device' && !!agencyConfig?.boundDeviceId;const remoteDeviceId = isDeviceMode ? agencyConfig.boundDeviceId : undefined;diff --git a/src/features/User/UserPanel/PanelContent.tsx b/src/features/User/UserPanel/PanelContent.tsxindex 52585cee5e3..e4e8658027a 100644--- a/src/features/User/UserPanel/PanelContent.tsx+++ b/src/features/User/UserPanel/PanelContent.tsx@@ -2,18 +2,17 @@ import { Flexbox } from '@lobehub/ui';import { type FC } from 'react';import BusinessPanelContent from '@/business/client/features/User/BusinessPanelContent';+import UserPanelStatistics from '@/business/client/features/User/UserPanelStatistics';import UserPanelWorkspaceSection from '@/business/client/features/User/UserPanelWorkspaceSection';import Menu from '@/components/Menu';import { isDesktop } from '@/const/version';import UserInfo from '@/features/User/UserInfo';-import WorkspaceLink from '@/features/Workspace/WorkspaceLink';import { navigateToDesktopOnboarding } from '@/routes/(desktop)/desktop-onboarding/navigation';import { DesktopOnboardingScreen } from '@/routes/(desktop)/desktop-onboarding/types';import { serverConfigSelectors, useServerConfigStore } from '@/store/serverConfig';import { useUserStore } from '@/store/user';import { authSelectors } from '@/store/user/selectors';-import DataStatistics from '../DataStatistics';import UserLoginOrSignup from '../UserLoginOrSignup';import LangButton from './LangButton';import { useMenu } from './useMenu';@@ -54,9 +53,7 @@ const PanelContent: FC<{ closePopover: () => void }> = ({ closePopover }) => {{isDesktop || isLoginWithAuth ? (<><UserInfo avatarProps={{ clickable: false }} />- <WorkspaceLink style={{ color: 'inherit' }} to={'/settings/stats'}>- <DataStatistics />- </WorkspaceLink>+ <UserPanelStatistics />{enableBusinessFeatures && <BusinessPanelContent />}<UserPanelWorkspaceSection onSwitch={closePopover} /></>diff --git a/src/helpers/executionTarget.test.ts b/src/helpers/executionTarget.test.tsindex 5443cf86a95..3ab05e0f21a 100644--- a/src/helpers/executionTarget.test.ts+++ b/src/helpers/executionTarget.test.ts@@ -120,6 +120,64 @@ describe('resolveExecutionTarget', () => {).toBe('sandbox');});+ describe('workspaceScoped — a workspace agent never executes on the member client', () => {+ it('suppresses the desktop `local` default (unset → none, hetero → sandbox)', () => {+ expect(+ resolveExecutionTarget(undefined, {+ clientExecutionAvailable: true,+ workspaceScoped: true,+ }),+ ).toBe('none');+ expect(+ resolveExecutionTarget(undefined, {+ clientExecutionAvailable: true,+ isHetero: true,+ workspaceScoped: true,+ }),+ ).toBe('sandbox');+ });++ it('coerces a stored `local` (pre-workspace leftover) to sandbox on desktop', () => {+ expect(+ resolveExecutionTarget(cfg({ executionTarget: 'local' }), {+ clientExecutionAvailable: true,+ workspaceScoped: true,+ }),+ ).toBe('sandbox');+ });++ it('routes a hetero stored `local` with a (grandfathered) binding to that device', () => {+ expect(+ resolveExecutionTarget(cfg({ boundDeviceId: 'device-a', executionTarget: 'local' }), {+ clientExecutionAvailable: true,+ isHetero: true,+ workspaceScoped: true,+ }),+ ).toBe('device');+ });++ it('leaves explicit non-local targets untouched', () => {+ expect(+ resolveExecutionTarget(cfg({ executionTarget: 'sandbox' }), {+ clientExecutionAvailable: true,+ workspaceScoped: true,+ }),+ ).toBe('sandbox');+ expect(+ resolveExecutionTarget(cfg({ executionTarget: 'device' }), {+ clientExecutionAvailable: true,+ workspaceScoped: true,+ }),+ ).toBe('device');+ expect(+ resolveExecutionTarget(cfg({ executionTarget: 'auto' }), {+ clientExecutionAvailable: true,+ workspaceScoped: true,+ }),+ ).toBe('auto');+ });+ });+describe('trigger=bot — upgrades a local target (bound → device, unbound → auto)', () => {it('coerces an UNBOUND desktop `local` (and the unset desktop default) to auto', () => {expect(diff --git a/src/helpers/executionTarget.ts b/src/helpers/executionTarget.tsindex 24066e31654..65009162ac9 100644--- a/src/helpers/executionTarget.ts+++ b/src/helpers/executionTarget.ts@@ -75,6 +75,18 @@ export interface ResolveExecutionTargetOptions {* and are left untouched.*/trigger?: RequestTrigger;+ /**+ * The agent belongs to a workspace (`agent.workspaceId` is set). Every+ * member runs a workspace agent through the shared device pool, so the+ * CURRENT member's own client is never a valid execution host — `local`+ * would silently run the shared agent on whichever personal machine opened+ * it. Treats client execution as unavailable: an unset target no longer+ * defaults to `local`, and a stored `local` (synced from before the agent+ * joined the workspace) coerces to `sandbox` — or, for hetero agents, to+ * `device` when a (grandfathered) `boundDeviceId` pins a machine, matching+ * the write-time guard in `AgentModel.assertWorkspaceDeviceBinding`.+ */+ workspaceScoped?: boolean;}/**@@ -126,20 +138,24 @@ export const resolveExecutionTarget = (deviceRoutingAvailable,isHetero,trigger,+ workspaceScoped,}: ResolveExecutionTargetOptions,): DeviceExecutionTarget => {+ // A workspace agent never executes on the current member's own client — see+ // `workspaceScoped` above. Same coercions as a client-less environment.+ const clientAvailable = clientExecutionAvailable && !workspaceScoped;const stored = agencyConfig?.executionTarget;- let effective = stored ?? (clientExecutionAvailable ? 'local' : 'none');+ let effective = stored ?? (clientAvailable ? 'local' : 'none');if (- !clientExecutionAvailable &&+ !clientAvailable &&(isHetero || deviceRoutingAvailable) &&stored === 'local' &&agencyConfig?.boundDeviceId) {return 'device';}- if (isHetero && effective === 'none') effective = clientExecutionAvailable ? 'local' : 'sandbox';- if (!clientExecutionAvailable && effective === 'local') return 'sandbox';+ if (isHetero && effective === 'none') effective = clientAvailable ? 'local' : 'sandbox';+ if (!clientAvailable && effective === 'local') return 'sandbox';// Bot trigger: a `local` target can't run in-process from the cloud bot// server, so it has to reach a real device. If the user pinned a specific// machine (the switcher persists that desktop's own `deviceId` as@@ -183,9 +199,14 @@ export const resolveRuntimeMode = (agencyConfig: LobeAgentAgencyConfig | undefined,clientExecutionAvailable: boolean,deviceRoutingAvailable?: boolean,+ workspaceScoped?: boolean,): RuntimeEnvMode =>executionTargetToRuntimeMode(- resolveExecutionTarget(agencyConfig, { clientExecutionAvailable, deviceRoutingAvailable }),+ resolveExecutionTarget(agencyConfig, {+ clientExecutionAvailable,+ deviceRoutingAvailable,+ workspaceScoped,+ }),);export type ExecutionPlanUnroutedReason =@@ -288,6 +309,8 @@ export interface ResolveExecutionPlanParams {* `resolveExecutionPlan`.*/trigger?: RequestTrigger;+ /** See {@link ResolveExecutionTargetOptions.workspaceScoped}. */+ workspaceScoped?: boolean;}/**@@ -321,6 +344,7 @@ export const resolveExecutionPlan = (params: ResolveExecutionPlanParams): ExecutonlineDeviceIds,requestedDeviceId,trigger,+ workspaceScoped,} = params;// Chat mode = no execution environment (plain chat). It's orthogonal to the@@ -334,6 +358,7 @@ export const resolveExecutionPlan = (params: ResolveExecutionPlanParams): ExecutisHetero,clientExecutionAvailable,trigger,+ workspaceScoped,});const wantsDevice =!!requestedDeviceId || target === 'device' || target === 'local' || target === 'auto';diff --git a/src/routes/(main)/agent/_layout/Sidebar/Topic/TopicListContent/ByProjectMode/GroupItem.test.tsx b/src/routes/(main)/agent/_layout/Sidebar/Topic/TopicListContent/ByProjectMode/GroupItem.test.tsxindex 90236a893f9..93780d4d9fa 100644--- a/src/routes/(main)/agent/_layout/Sidebar/Topic/TopicListContent/ByProjectMode/GroupItem.test.tsx+++ b/src/routes/(main)/agent/_layout/Sidebar/Topic/TopicListContent/ByProjectMode/GroupItem.test.tsx@@ -125,6 +125,7 @@ vi.mock('@/store/agent/selectors', () => ({agentByIdSelectors: {getAgencyConfigById: () => () => ({ boundDeviceId: 'device-1' }),isAgentHeterogeneousById: () => () => true,+ isWorkspaceAgentById: () => () => false,},agentSelectors: {getAgentConfigById: () => () => undefined,diff --git a/src/routes/(main)/agent/_layout/Sidebar/Topic/TopicListContent/ByProjectMode/GroupItem.tsx b/src/routes/(main)/agent/_layout/Sidebar/Topic/TopicListContent/ByProjectMode/GroupItem.tsxindex bc821c7ad7e..3860e4fb993 100644--- a/src/routes/(main)/agent/_layout/Sidebar/Topic/TopicListContent/ByProjectMode/GroupItem.tsx+++ b/src/routes/(main)/agent/_layout/Sidebar/Topic/TopicListContent/ByProjectMode/GroupItem.tsx@@ -232,6 +232,9 @@ const GroupItem = memo<GroupItemComponentProps>(const isHeterogeneous = useAgentStore((s) =>currentAgentId ? agentByIdSelectors.isAgentHeterogeneousById(currentAgentId)(s) : false,);+ const isWorkspaceAgent = useAgentStore((s) =>+ currentAgentId ? agentByIdSelectors.isWorkspaceAgentById(currentAgentId)(s) : false,+ );const { commitAgentDefault } = useCommitWorkingDirectory(currentAgentId ?? '');const handleAddTopic = useCallback(async () => {@@ -261,6 +264,7 @@ const GroupItem = memo<GroupItemComponentProps>(clientExecutionAvailable: isDesktop,deviceRoutingAvailable,isHetero: isHeterogeneous,+ workspaceScoped: isWorkspaceAgent,});const isDeviceMode = effectiveTarget === 'device' && !!agencyConfig?.boundDeviceId;const canAddTopic = (isDesktop || isDeviceMode) && !!workingDirectory;diff --git a/src/routes/(main)/agent/features/Conversation/HeterogeneousChatInput/HeteroControlBar.tsx b/src/routes/(main)/agent/features/Conversation/HeterogeneousChatInput/HeteroControlBar.tsxindex bc3aa33433a..c45a0a1bab5 100644--- a/src/routes/(main)/agent/features/Conversation/HeterogeneousChatInput/HeteroControlBar.tsx+++ b/src/routes/(main)/agent/features/Conversation/HeterogeneousChatInput/HeteroControlBar.tsx@@ -70,6 +70,7 @@ const HeteroControlBar = memo(() => {// All hooks must be called unconditionally (Rules of Hooks)const isLoading = useAgentStore(agentByIdSelectors.isAgentConfigLoadingById(agentId));const agencyConfig = useAgentStore(agentByIdSelectors.getAgencyConfigById(agentId));+ const isWorkspaceAgent = useAgentStore(agentByIdSelectors.isWorkspaceAgentById(agentId));// On web there's no full-access badge / skeleton — just the workspace controls// (the cloud repo switcher is rendered inside WorkspaceControls). The CLI@@ -106,6 +107,7 @@ const HeteroControlBar = memo(() => {resolveExecutionTarget(agencyConfig, {clientExecutionAvailable: isDesktop,isHetero: true,+ workspaceScoped: isWorkspaceAgent,}) === 'local';const shouldShowCodexQuota = heteroProvider?.type === 'codex' && isLocalHeteroExecution;const shouldShowClaudeQuota = heteroProvider?.type === 'claude-code' && isLocalHeteroExecution;diff --git a/src/routes/(main)/agent/features/Conversation/HeterogeneousChatInput/index.tsx b/src/routes/(main)/agent/features/Conversation/HeterogeneousChatInput/index.tsxindex 4015b72324d..d7ac0628b43 100644--- a/src/routes/(main)/agent/features/Conversation/HeterogeneousChatInput/index.tsx+++ b/src/routes/(main)/agent/features/Conversation/HeterogeneousChatInput/index.tsx@@ -21,7 +21,7 @@ import WideScreenContainer from '@/features/WideScreenContainer';import { resolveExecutionTarget } from '@/helpers/executionTarget';import { useRemoteAgentDeviceGuard } from '@/hooks/useRemoteAgentDeviceGuard';import { useAgentStore } from '@/store/agent';-import { agentSelectors } from '@/store/agent/selectors';+import { agentByIdSelectors, agentSelectors } from '@/store/agent/selectors';import { useChatStore } from '@/store/chat';import HeteroControlBar from './HeteroControlBar';@@ -90,9 +90,11 @@ const HeterogeneousChatInput = memo(() => {(s) => agentSelectors.getAgentConfigById(agentId)(s)?.agencyConfig,);const providerType = agencyConfig?.heterogeneousProvider?.type;+ const isWorkspaceAgent = useAgentStore(agentByIdSelectors.isWorkspaceAgentById(agentId));const executionTarget = resolveExecutionTarget(agencyConfig, {isHetero: !!providerType,clientExecutionAvailable: isDesktop,+ workspaceScoped: isWorkspaceAgent,});const isRemoteAgent = !!providerType && isRemoteHeterogeneousType(providerType);diff --git a/src/routes/(main)/agent/features/Conversation/WorkingSidebar/index.tsx b/src/routes/(main)/agent/features/Conversation/WorkingSidebar/index.tsxindex d05f49bd735..05bc5ff758a 100644--- a/src/routes/(main)/agent/features/Conversation/WorkingSidebar/index.tsx+++ b/src/routes/(main)/agent/features/Conversation/WorkingSidebar/index.tsx@@ -116,10 +116,14 @@ const AgentWorkingSidebar = memo(() => {const targetDeviceId = resolveTargetDeviceId(agencyConfig, currentDeviceId);const repoType = useRepoType(workingDirectory, targetDeviceId);const deviceRoutingAvailable = useIsGatewayModeEnabled(activeAgentId);+ const isWorkspaceAgent = useAgentStore((s) =>+ activeAgentId ? agentByIdSelectors.isWorkspaceAgentById(activeAgentId)(s) : false,+ );const effectiveTarget = resolveExecutionTarget(agencyConfig, {clientExecutionAvailable: isDesktop,deviceRoutingAvailable,isHetero,+ workspaceScoped: isWorkspaceAgent,});// Running against a bound device (remote, or this machine as a device): filediff --git a/src/routes/(main)/home/_layout/Body/Private/CreatePrivateButton.tsx b/src/routes/(main)/home/_layout/Body/Private/CreatePrivateButton.tsxdeleted file mode 100644index e52429ed1aa..00000000000--- a/src/routes/(main)/home/_layout/Body/Private/CreatePrivateButton.tsx+++ /dev/null@@ -1,129 +0,0 @@-'use client';--import { ActionIcon, Block, Center, DropdownMenu, Flexbox, Icon, Text, Tooltip } from '@lobehub/ui';-import { createStaticStyles, cssVar, cx } from 'antd-style';-import { ChevronDownIcon, PlusIcon } from 'lucide-react';-import { memo, useMemo } from 'react';-import { useTranslation } from 'react-i18next';--import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';-import { usePermission } from '@/hooks/usePermission';--import { useCreateMenuItems } from '../../hooks';--const ACTION_CLASS_NAME = 'create-private-actions';--const styles = createStaticStyles(({ css }) => ({- container: css`- .${ACTION_CLASS_NAME} {- width: 0;- margin-inline-end: 2px;- opacity: 0;- transition: opacity 0.2s ${cssVar.motionEaseOut};-- &:has([data-popup-open]) {- width: unset;- opacity: 1;- }- }-- &:hover {- .${ACTION_CLASS_NAME} {- width: unset;- opacity: 1;- }- }- `,-}));--interface CreatePrivateButtonProps {- className?: string;-}--// "+ Add new" entry inside the Private section. Mirrors-// CreateAgentButton but every create entry it produces is hard-pinned to-// `visibility: 'private'` so nothing leaks into the workspace-shared-// bucket. Acts as both the visible affordance for the empty private list-// and the trailing entry for a populated one.-const CreatePrivateButton = memo<CreatePrivateButtonProps>(({ className }) => {- const { t } = useTranslation('chat');- const { allowed: canCreate, reason } = usePermission('create_content');- const {- createAgent,- createAgentMenuItem,- createGroupChatMenuItem,- createPlatformAgentMenuItem,- isMutatingAgent,- openCreateModal,- } = useCreateMenuItems();-- const dropdownItems = useMemo(() => {- const platformItem = createPlatformAgentMenuItem({ visibility: 'private' });- return [- createAgentMenuItem({ visibility: 'private' }),- createGroupChatMenuItem({ visibility: 'private' }),- ...(platformItem ? [{ type: 'divider' as const }, platformItem] : []),- ];- }, [createAgentMenuItem, createGroupChatMenuItem, createPlatformAgentMenuItem]);-- const handleClick = () => {- if (!canCreate) return;- if (openCreateModal) {- openCreateModal('agent', { visibility: 'private' });- } else {- createAgent({ visibility: 'private' });- }- };-- const content = (- <Block- horizontal- align={'center'}- className={cx(styles.container, className)}- clickable={canCreate}- gap={8}- height={36}- paddingInline={4}- style={canCreate ? { height: 36 } : { cursor: 'not-allowed', height: 36, opacity: 0.5 }}- variant={'borderless'}- onClick={handleClick}- >- <Center flex={'none'} height={28} width={28}>- {isMutatingAgent ? (- <NeuralNetworkLoading size={14} />- ) : (- <Icon icon={PlusIcon} size={'small'} />- )}- </Center>- <Text style={{ flex: 1 }} type={'secondary'}>- {t('newAgent')}- </Text>- {canCreate && (- <Flexbox- horizontal- align={'center'}- className={ACTION_CLASS_NAME}- flex={'none'}- justify={'flex-end'}- onClick={(e) => {- e.preventDefault();- e.stopPropagation();- }}- >- <DropdownMenu items={dropdownItems} nativeButton={false}>- <ActionIcon- color={cssVar.colorTextQuaternary}- icon={ChevronDownIcon}- size={'small'}- style={{ flex: 'none' }}- />- </DropdownMenu>- </Flexbox>- )}- </Block>- );-- return canCreate ? content : <Tooltip title={reason}>{content}</Tooltip>;-});--export default CreatePrivateButton;diff --git a/src/routes/(main)/home/_layout/Body/Private/List.tsx b/src/routes/(main)/home/_layout/Body/Private/List.tsxindex 7e2dedcfd90..a83fad73c66 100644--- a/src/routes/(main)/home/_layout/Body/Private/List.tsx+++ b/src/routes/(main)/home/_layout/Body/Private/List.tsx@@ -13,9 +13,9 @@ import { systemStatusSelectors } from '@/store/global/selectors';import { useHomeStore } from '@/store/home';import { homeAgentListSelectors } from '@/store/home/selectors';+import CreateAgentButton from '../Agent/CreateAgentButton';import Group from '../Agent/List/Group';import SessionList from '../Agent/List/List';-import CreatePrivateButton from './CreatePrivateButton';interface PrivateListProps {hideCreateButton?: boolean;@@ -53,7 +53,7 @@ const PrivateList = memo<PrivateListProps>(({ hideCreateButton, onMoreClick }) =if (hideCreateButton) return null;return (<Flexbox gap={1} paddingBlock={1}>- <CreatePrivateButton />+ <CreateAgentButton visibility={'private'} /></Flexbox>);}@@ -65,7 +65,7 @@ const PrivateList = memo<PrivateListProps>(({ hideCreateButton, onMoreClick }) ={hasMore && (<NavItem icon={MoreHorizontal} title={t('input.more')} onClick={handleMoreClick} />)}- {!hideCreateButton && <CreatePrivateButton />}+ {!hideCreateButton && <CreateAgentButton visibility={'private'} />}</Flexbox>);});diff --git a/src/routes/(main)/home/features/InputArea/BotIntegrationBanner.tsx b/src/routes/(main)/home/features/InputArea/BotIntegrationBanner.tsxdeleted file mode 100644index cb8c016b7ae..00000000000--- a/src/routes/(main)/home/features/InputArea/BotIntegrationBanner.tsx+++ /dev/null@@ -1,160 +0,0 @@-'use client';--import { ActionIcon, Flexbox, Icon } from '@lobehub/ui';-import { createStaticStyles } from 'antd-style';-import { RadioTowerIcon, X } from 'lucide-react';-import type { FC } from 'react';-import React, { memo, useCallback, useMemo } from 'react';-import { useTranslation } from 'react-i18next';--import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';-import { getPlatformIcon } from '@/routes/(main)/agent/channel/const';-import { useAgentStore } from '@/store/agent';-import { builtinAgentSelectors } from '@/store/agent/selectors/builtinAgentSelectors';-import { useGlobalStore } from '@/store/global';--// Bump this id when the banner content changes so dismissing the old-// variant does not hide the new one.-export const BOT_INTEGRATION_BANNER_ID = 'bot-integration-v2';--const ICON_SIZE = 16;-const AVATAR_SIZE = 24;--const BANNER_PLATFORM_NAMES = [- 'Discord',- 'Slack',- 'Telegram',- 'Line',- 'Lark',- 'WeChat',- 'QQ',-] as const;--const styles = createStaticStyles(({ css, cssVar }) => ({- avatar: css`- display: flex;- flex-shrink: 0;- align-items: center;- justify-content: center;-- width: ${AVATAR_SIZE}px;- height: ${AVATAR_SIZE}px;- border-radius: 50%;-- background: ${cssVar.colorBgContainer};- box-shadow:- 0 0 8px -2px rgb(0 0 0 / 5%),- 0 0 0 1px ${cssVar.colorFillTertiary};- `,- banner: css`- cursor: pointer;-- position: absolute;- z-index: 0;- inset-block-end: 0;- inset-inline: 0;-- display: flex;- gap: 12px;- align-items: center;- justify-content: space-between;-- margin-block-end: -6px;- padding-block: 42px 10px;- padding-inline: 16px 12px;- border: 1px solid ${cssVar.colorFillSecondary};- border-radius: 20px;-- background: color-mix(in srgb, ${cssVar.colorFillQuaternary} 50%, ${cssVar.colorBgContainer});- `,- icon: css`- color: ${cssVar.colorTextSecondary};- `,- iconGroup: css`- display: flex;- align-items: center;- `,- text: css`- font-size: 13px;- color: ${cssVar.colorTextSecondary};- `,-}));--const BotIntegrationBanner = memo(() => {- const { t } = useTranslation('common');- const navigate = useWorkspaceAwareNavigate();-- const inboxAgentId = useAgentStore(builtinAgentSelectors.inboxAgentId);- const updateSystemStatus = useGlobalStore((s) => s.updateSystemStatus);-- const platformIcons = useMemo(() => {- const icons: Array<{ Icon: FC<any>; key: string }> = [];-- for (const name of BANNER_PLATFORM_NAMES) {- const PlatformIcon = getPlatformIcon(name);- if (!PlatformIcon) continue;- const ColorIcon =- 'Color' in PlatformIcon- ? ((PlatformIcon as any).Color as FC<any>)- : (PlatformIcon as FC<any>);- icons.push({ Icon: ColorIcon, key: name });- }-- return icons;- }, []);-- const handleNavigateToChannels = useCallback(() => {- if (!inboxAgentId) return;- navigate(`/agent/${inboxAgentId}/channel`);- }, [inboxAgentId, navigate]);-- const handleDismiss = useCallback(- (e: React.MouseEvent) => {- e.stopPropagation();- const current = useGlobalStore.getState().status.dismissedBannerIds || [];- if (current.includes(BOT_INTEGRATION_BANNER_ID)) return;- updateSystemStatus({- dismissedBannerIds: [...current, BOT_INTEGRATION_BANNER_ID],- });- },- [updateSystemStatus],- );-- return (- <div- className={styles.banner}- data-testid="bot-integration-banner"- onClick={handleNavigateToChannels}- >- <Flexbox horizontal align="center" gap={8}>- <Icon className={styles.icon} icon={RadioTowerIcon} size={18} />- <span className={styles.text}>{t('botIntegrationBanner.title')}</span>- </Flexbox>- <Flexbox horizontal align="center" gap={8}>- {platformIcons.length > 0 && (- <div className={styles.iconGroup}>- {platformIcons.map(({ Icon: PlatformIcon, key }, index) => (- <div- className={styles.avatar}- key={key}- style={{ marginLeft: index === 0 ? 0 : -6, zIndex: index }}- >- <PlatformIcon size={ICON_SIZE} />- </div>- ))}- </div>- )}- <ActionIcon- icon={X}- size="small"- title={t('botIntegrationBanner.dismiss')}- onClick={handleDismiss}- />- </Flexbox>- </div>- );-});--BotIntegrationBanner.displayName = 'BotIntegrationBanner';--export default BotIntegrationBanner;diff --git a/src/routes/(main)/home/features/InputArea/SkillInstallBanner.tsx b/src/routes/(main)/home/features/InputArea/SkillInstallBanner.tsxdeleted file mode 100644index cb71a9eff7d..00000000000--- a/src/routes/(main)/home/features/InputArea/SkillInstallBanner.tsx+++ /dev/null@@ -1,171 +0,0 @@-'use client';--import { getComposioAppByIdentifier, getLobehubSkillProviderById } from '@lobechat/const';-import { ActionIcon, Flexbox, Icon } from '@lobehub/ui';-import { createStaticStyles } from 'antd-style';-import { Blocks, X } from 'lucide-react';-import React, { createElement, memo, useCallback, useMemo } from 'react';-import { useTranslation } from 'react-i18next';--import { createSkillStoreModal } from '@/features/SkillStore';-import { useGlobalStore } from '@/store/global';-import { serverConfigSelectors, useServerConfigStore } from '@/store/serverConfig';-import { useToolStore } from '@/store/tool';--// Bump this id when the banner content changes so dismissing the old-// variant does not hide the new one.-export const SKILL_INSTALL_BANNER_ID = 'skill-install-v2';--const ICON_SIZE = 16;-const AVATAR_SIZE = 24;--const styles = createStaticStyles(({ css, cssVar }) => ({- avatar: css`- display: flex;- flex-shrink: 0;- align-items: center;- justify-content: center;-- width: ${AVATAR_SIZE}px;- height: ${AVATAR_SIZE}px;- border-radius: 50%;-- background: ${cssVar.colorBgContainer};- box-shadow:- 0 0 8px -2px rgb(0 0 0 / 5%),- 0 0 0 1px ${cssVar.colorFillTertiary};- `,- banner: css`- cursor: pointer;-- position: absolute;- z-index: 0;- inset-block-end: 0;- inset-inline: 0;-- display: flex;- gap: 12px;- align-items: center;- justify-content: space-between;-- margin-block-end: -6px;- padding-block: 42px 10px;- padding-inline: 16px 12px;- border: 1px solid ${cssVar.colorFillSecondary};- border-radius: 20px;-- background: color-mix(in srgb, ${cssVar.colorFillQuaternary} 50%, ${cssVar.colorBgContainer});- `,- icon: css`- color: ${cssVar.colorTextSecondary};- `,- iconGroup: css`- display: flex;- align-items: center;- `,- text: css`- font-size: 13px;- color: ${cssVar.colorTextSecondary};- `,-}));--const BANNER_SKILL_IDS = [- { id: 'gmail', type: 'composio' },- { id: 'google-drive', type: 'composio' },- { id: 'google-calendar', type: 'composio' },- { id: 'slack', type: 'composio' },- { id: 'notion', type: 'lobehub' },- { id: 'twitter', type: 'lobehub' },- { id: 'github', type: 'lobehub' },-] as const;--const SkillInstallBanner = memo(() => {- const { t } = useTranslation('plugin');-- const isLobehubSkillEnabled = useServerConfigStore(serverConfigSelectors.enableLobehubSkill);- const isComposioEnabled = useServerConfigStore(serverConfigSelectors.enableComposio);-- const updateSystemStatus = useGlobalStore((s) => s.updateSystemStatus);-- // Prefetch skill connections data so SkillStore opens faster- const [useFetchLobehubSkillConnections, useFetchUserComposioConnections] = useToolStore((s) => [- s.useFetchLobehubSkillConnections,- s.useFetchUserComposioConnections,- ]);- useFetchLobehubSkillConnections(isLobehubSkillEnabled);- useFetchUserComposioConnections(isComposioEnabled);-- const skillIcons = useMemo(() => {- const icons: Array<{ icon: string | React.ComponentType<{ size?: number }>; key: string }> = [];-- for (const skill of BANNER_SKILL_IDS) {- if (skill.type === 'lobehub') {- const provider = getLobehubSkillProviderById(skill.id);- if (provider) {- icons.push({ icon: provider.icon, key: provider.id });- }- } else {- const server = getComposioAppByIdentifier(skill.id);- if (server) {- icons.push({ icon: server.icon, key: server.identifier });- }- }- }-- return icons;- }, []);-- const handleOpenStore = useCallback(() => {- createSkillStoreModal();- }, []);-- const handleDismiss = useCallback(- (e: React.MouseEvent) => {- e.stopPropagation();- const current = useGlobalStore.getState().status.dismissedBannerIds || [];- if (current.includes(SKILL_INSTALL_BANNER_ID)) return;- updateSystemStatus({- dismissedBannerIds: [...current, SKILL_INSTALL_BANNER_ID],- });- },- [updateSystemStatus],- );-- return (- <div className={styles.banner} data-testid="skill-install-banner" onClick={handleOpenStore}>- <Flexbox horizontal align="center" gap={4}>- <Icon className={styles.icon} icon={Blocks} size={18} />- <span className={styles.text}>{t('skillInstallBanner.title')}</span>- </Flexbox>- <Flexbox horizontal align="center" gap={8}>- {skillIcons.length > 0 && (- <div className={styles.iconGroup}>- {skillIcons.map(({ icon, key }, index) => (- <div- className={styles.avatar}- key={key}- style={{ marginLeft: index === 0 ? 0 : -6, zIndex: index }}- >- {typeof icon === 'string' ? (- <img alt={key} height={ICON_SIZE} src={icon} width={ICON_SIZE} />- ) : (- createElement(icon, { size: ICON_SIZE })- )}- </div>- ))}- </div>- )}- <ActionIcon- icon={X}- size="small"- title={t('skillInstallBanner.dismiss')}- onClick={handleDismiss}- />- </Flexbox>- </div>- );-});--SkillInstallBanner.displayName = 'SkillInstallBanner';--export default SkillInstallBanner;diff --git a/src/routes/(main)/home/features/InputArea/index.tsx b/src/routes/(main)/home/features/InputArea/index.tsxindex d31050f7673..0d780b0e125 100644--- a/src/routes/(main)/home/features/InputArea/index.tsx+++ b/src/routes/(main)/home/features/InputArea/index.tsx@@ -1,5 +1,5 @@import { Flexbox } from '@lobehub/ui';-import { useEffect, useMemo, useRef, useState } from 'react';+import { useMemo, useRef } from 'react';import { useUploadFiles } from '@/components/DragUploadZone';import { type ActionKeys } from '@/features/ChatInput';@@ -8,25 +8,19 @@ import { useHomeDailyBrief } from '@/hooks/useHomeDailyBrief';import { useInitAgentConfig } from '@/hooks/useInitAgentConfig';import { useAgentStore } from '@/store/agent';import { agentByIdSelectors } from '@/store/agent/selectors';-import { builtinAgentSelectors } from '@/store/agent/selectors/builtinAgentSelectors';import { useChatStore } from '@/store/chat';import { useGlobalStore } from '@/store/global';import { systemStatusSelectors } from '@/store/global/selectors';-import { serverConfigSelectors, useServerConfigStore } from '@/store/serverConfig';-import BotIntegrationBanner, { BOT_INTEGRATION_BANNER_ID } from './BotIntegrationBanner';import { stripMarkdownLinks } from './hintFormat';import InputDragUpload from './InputDragUpload';import MessengerBanner, { MESSENGER_BANNER_ID } from './MessengerBanner';-import SkillInstallBanner, { SKILL_INSTALL_BANNER_ID } from './SkillInstallBanner';import StarterList from './StarterList';import { useSend } from './useSend';const leftActions: ActionKeys[] = ['agentMode', 'plus'];const rightActions: ActionKeys[] = ['modelLabel'];-type BannerKind = 'skill' | 'botIntegration' | 'messenger';-const InputArea = () => {const { loading, send, agentId } = useSend();// Subscribe to the SWR key so `internal_refreshAgentConfig`'s `mutate(...)`@@ -40,58 +34,15 @@ const InputArea = () => {const isAgentConfigLoading = useAgentStore((s) =>agentByIdSelectors.isAgentConfigLoadingById(agentId ?? '')(s),);- const inboxAgentId = useAgentStore(builtinAgentSelectors.inboxAgentId);- const isLobehubSkillEnabled = useServerConfigStore(serverConfigSelectors.enableLobehubSkill);- const isComposioEnabled = useServerConfigStore(serverConfigSelectors.enableComposio);- const serverConfigInit = useServerConfigStore((s) => s.serverConfigInit);- const isSkillBannerDismissed = useGlobalStore(- systemStatusSelectors.isBannerDismissed(SKILL_INSTALL_BANNER_ID),- );- const isBotIntegrationBannerDismissed = useGlobalStore(- systemStatusSelectors.isBannerDismissed(BOT_INTEGRATION_BANNER_ID),- );const isMessengerBannerDismissed = useGlobalStore(systemStatusSelectors.isBannerDismissed(MESSENGER_BANNER_ID),);+ // Wait for the persisted status to hydrate so users who already dismissed+ // the banner never see it flash on mount.+ const isStatusInit = useGlobalStore(systemStatusSelectors.isStatusInit);const chatInputRef = useRef<HTMLDivElement>(null);- // Wait for both stores to finish hydrating before drawing — server config- // (skill flags) and the agent store (inboxAgentId) hydrate at different- // times, and picking too early biases the draw toward whichever arrived- // first. After picking, dismissing the active banner only hides it for- // this mount — re-mounting re-rolls from the still-undismissed pool.- const [activeBanner, setActiveBanner] = useState<BannerKind | null>(null);- const hasPickedRef = useRef(false);-- useEffect(() => {- if (hasPickedRef.current) return;- if (!serverConfigInit || !inboxAgentId) return;-- const candidates: BannerKind[] = [];- if ((isLobehubSkillEnabled || isComposioEnabled) && !isSkillBannerDismissed) {- candidates.push('skill');- }- if (!isBotIntegrationBannerDismissed) candidates.push('botIntegration');- if (!isMessengerBannerDismissed) candidates.push('messenger');- if (candidates.length === 0) return;-- hasPickedRef.current = true;- setActiveBanner(candidates[Math.floor(Math.random() * candidates.length)]);- }, [- inboxAgentId,- isBotIntegrationBannerDismissed,- isComposioEnabled,- isLobehubSkillEnabled,- isMessengerBannerDismissed,- isSkillBannerDismissed,- serverConfigInit,- ]);-- const isActiveBannerDismissed =- (activeBanner === 'skill' && isSkillBannerDismissed) ||- (activeBanner === 'botIntegration' && isBotIntegrationBannerDismissed) ||- (activeBanner === 'messenger' && isMessengerBannerDismissed);- const visibleBanner = isActiveBannerDismissed ? null : activeBanner;+ const showMessengerBanner = isStatusInit && !isMessengerBannerDismissed;// Get agent's model info for vision support check. Falls back to an empty// id while the agent id resolves; the selectors return DEFAULT_MODEL /@@ -127,11 +78,9 @@ const InputArea = () => {<Flexbox gap={16} style={{ marginBottom: 16 }}><Flexboxref={chatInputRef}- style={{ paddingBottom: visibleBanner ? 32 : 0, position: 'relative' }}+ style={{ paddingBottom: showMessengerBanner ? 32 : 0, position: 'relative' }}>- {visibleBanner === 'skill' && <SkillInstallBanner />}- {visibleBanner === 'botIntegration' && <BotIntegrationBanner />}- {visibleBanner === 'messenger' && <MessengerBanner />}+ {showMessengerBanner && <MessengerBanner />}<InputDragUploadradius={20}style={{ position: 'relative', zIndex: 1 }}diff --git a/src/store/agent/selectors/agentByIdSelectors.ts b/src/store/agent/selectors/agentByIdSelectors.tsindex 23728b30221..da33bf17d17 100644--- a/src/store/agent/selectors/agentByIdSelectors.ts+++ b/src/store/agent/selectors/agentByIdSelectors.ts@@ -178,6 +178,16 @@ const isAgentHeterogeneousById =*/const getAgentById = (agentId: string) => (s: AgentStoreState) => s.agentMap[agentId];+/**+ * Workspace-scoped agent: shared across workspace members, so it executes on+ * the workspace device pool / sandbox — never on the current member's own+ * client. Feed this into `resolveExecutionTarget`'s `workspaceScoped` option.+ */+const isWorkspaceAgentById =+ (agentId: string) =>+ (s: AgentStoreState): boolean =>+ !!s.agentMap[agentId]?.workspaceId;+export const agentByIdSelectors = {getAgencyConfigById,getAgentBuilderContextById,@@ -198,4 +208,5 @@ export const agentByIdSelectors = {getAgentWorkingDirectoryById,isAgentConfigLoadingById,isAgentHeterogeneousById,+ isWorkspaceAgentById,};diff --git a/src/store/agent/selectors/chatConfigByIdSelectors.ts b/src/store/agent/selectors/chatConfigByIdSelectors.tsindex 66583b2ff36..81e29a80060 100644--- a/src/store/agent/selectors/chatConfigByIdSelectors.ts+++ b/src/store/agent/selectors/chatConfigByIdSelectors.ts@@ -78,10 +78,13 @@ const getRuntimeModeById =// when Gateway mode is effectively enabled and can route to the device// (LOBE-11473). Derive the gate from this selector's own state `s` so it// re-evaluates on `disableGatewayMode` changes without a second global read.+ // Workspace agents never execute on the current member's own client —+ // their default/stored `local` coerces away (see `workspaceScoped`).return resolveRuntimeMode(config?.agencyConfig,isDesktop,resolveGatewayModeEnabled(s, agentId),+ !!s.agentMap[agentId]?.workspaceId,);};diff --git a/src/store/agent/slices/agent/action.test.ts b/src/store/agent/slices/agent/action.test.tsindex 30f8acd6a4a..c20ae9a335e 100644--- a/src/store/agent/slices/agent/action.test.ts+++ b/src/store/agent/slices/agent/action.test.ts@@ -2,6 +2,7 @@ import { CHAT_GROUP_SESSION_ID_PREFIX } from '@lobechat/types';import { act, renderHook, waitFor } from '@testing-library/react';import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';+import { message } from '@/components/AntdStaticMethods';import { setScopedMutate } from '@/libs/swr';import { agentConfigKeys } from '@/libs/swr/keys';import { agentService } from '@/services/agent';@@ -38,6 +39,12 @@ vi.mock('@/services/agentDocument', () => ({resolveAgentDocumentsContext: vi.fn(),}));+vi.mock('@/components/AntdStaticMethods', () => ({+ message: {+ error: vi.fn(),+ },+}));+// Mock sessionStorevi.mock('@/store/session', () => ({useSessionStore: {@@ -390,6 +397,32 @@ describe('AgentSlice Actions', () => {expect.any(AbortSignal),);});++ it('should surface the failure and roll back to server truth when the save is rejected', async () => {+ const { result } = renderHook(() => useAgentStore());++ vi.mocked(agentService.updateAgentConfig).mockRejectedValue(+ new Error('Workspace agent can only bind devices enrolled in the same workspace.'),+ );+ vi.spyOn(console, 'error').mockImplementation(() => {});++ act(() => {+ useAgentStore.setState({ activeAgentId: 'agent-1' });+ });++ const refreshSpy = vi.spyOn(result.current, 'internal_refreshAgentConfig');++ await act(async () => {+ await result.current.updateAgentConfig({+ agencyConfig: { boundDeviceId: 'personal-device', executionTarget: 'device' },+ });+ });++ expect(message.error).toHaveBeenCalled();+ // Optimistic value must not survive a rejected write — refetch server truth.+ expect(refreshSpy).toHaveBeenCalledWith('agent-1');+ expect(result.current.saveStatus).toBe('idle');+ });});describe('updateAgentMeta', () => {diff --git a/src/store/agent/slices/agent/action.ts b/src/store/agent/slices/agent/action.tsindex 032d60e9c8c..faa00c0fc27 100644--- a/src/store/agent/slices/agent/action.ts+++ b/src/store/agent/slices/agent/action.ts@@ -7,10 +7,12 @@ import {} from '@lobechat/types';import { getSingletonAnalyticsOptional } from '@lobehub/analytics';import isEqual from 'fast-deep-equal';+import { t } from 'i18next';import { produce } from 'immer';import type { SWRResponse } from 'swr';import type { PartialDeep } from 'type-fest';+import { message } from '@/components/AntdStaticMethods';import { MESSAGE_CANCEL_FLAT } from '@/const/message';import { mutate, useClientDataSWRWithSync } from '@/libs/swr';import { agentConfigKeys } from '@/libs/swr/keys';@@ -533,6 +535,17 @@ export class AgentSliceActionImpl {} else {console.error('[AgentStore] Failed to save config:', error);updateSaveStatus('idle');+ // A swallowed failure reads as saved and surfaces later as mysterious+ // data loss (the next refetch reverts the optimistic value) — tell the+ // user right away.+ message.error(t('saveAgentConfigFail', { ns: 'common' }));+ // Roll back only agencyConfig patches: those are discrete picks the+ // server actively validates (e.g. a workspace agent binding a+ // non-workspace device is rejected), so keeping the optimistic value+ // just shows a selection that never persisted. Other config fields keep+ // the optimistic value on purpose — refetching would clobber in-flight+ // form edits on a transient failure (see #16337).+ if (data.agencyConfig) await this.#get().internal_refreshAgentConfig(id);}}};diff --git a/src/store/chat/slices/agentRun/actions/__tests__/agentDispatcher.test.ts b/src/store/chat/slices/agentRun/actions/__tests__/agentDispatcher.test.tsindex 1bf3b9d0f7d..a205290876a 100644--- a/src/store/chat/slices/agentRun/actions/__tests__/agentDispatcher.test.ts+++ b/src/store/chat/slices/agentRun/actions/__tests__/agentDispatcher.test.ts@@ -165,6 +165,28 @@ describe('selectRuntimeType', () => {});});+ describe('isWorkspaceAgent — workspace agents never spawn in-process on the member desktop', () => {+ it('routes desktop local / unset targets to gateway for workspace agents', () => {+ expect(+ selectRuntimeType(+ {+ executionTarget: 'local',+ heterogeneousProvider: heteroProvider,+ isGatewayMode: false,+ isWorkspaceAgent: true,+ },+ { isDesktop: true },+ ),+ ).toBe('gateway');+ expect(+ selectRuntimeType(+ { heterogeneousProvider: heteroProvider, isGatewayMode: false, isWorkspaceAgent: true },+ { isDesktop: true },+ ),+ ).toBe('gateway');+ });+ });+describe('parentRuntime override', () => {it('parentRuntime wins over every other signal', () => {expect(diff --git a/src/store/chat/slices/agentRun/actions/dispatch/agentDispatcher.ts b/src/store/chat/slices/agentRun/actions/dispatch/agentDispatcher.tsindex 78e20853e8f..6b26d994cce 100644--- a/src/store/chat/slices/agentRun/actions/dispatch/agentDispatcher.ts+++ b/src/store/chat/slices/agentRun/actions/dispatch/agentDispatcher.ts@@ -66,6 +66,14 @@ export interface RuntimeSelectionContext {heterogeneousProvider?: HeterogeneousProviderConfig;/** Result of `chatStore.isGatewayModeEnabled()`. */isGatewayMode: boolean;+ /**+ * The agent is workspace-scoped (`agent.workspaceId` set). Workspace agents+ * never execute in-process on the current member's own desktop — a+ * default/stored `local` target coerces to sandbox/device, so the run+ * routes through the gateway (see `resolveExecutionTarget`'s+ * `workspaceScoped`).+ */+ isWorkspaceAgent?: boolean;/*** Explicit override that wins over automatic selection.*@@ -111,7 +119,11 @@ export const selectRuntimeType = (const target = resolveExecutionTarget({ boundDeviceId: ctx.boundDeviceId, executionTarget: ctx.executionTarget },// on the client the desktop build IS where local execution is available- { isHetero: true, clientExecutionAvailable: isDesktop },+ {+ isHetero: true,+ clientExecutionAvailable: isDesktop,+ workspaceScoped: ctx.isWorkspaceAgent,+ },);return target === 'local' ? 'hetero' : 'gateway';}diff --git a/src/store/chat/slices/agentRun/actions/dispatch/nonHeteroSubAgentDispatcher.ts b/src/store/chat/slices/agentRun/actions/dispatch/nonHeteroSubAgentDispatcher.tsindex 281b7088fa1..303de6d9fc4 100644--- a/src/store/chat/slices/agentRun/actions/dispatch/nonHeteroSubAgentDispatcher.ts+++ b/src/store/chat/slices/agentRun/actions/dispatch/nonHeteroSubAgentDispatcher.ts@@ -31,6 +31,8 @@ export interface NonHeteroSubAgentDispatchContext {inPortalThread?: boolean;/** Current gateway mode status (`chatStore.isGatewayModeEnabled()`). */isGatewayMode: boolean;+ /** Parent agent is workspace-scoped — see `RuntimeSelectionContext.isWorkspaceAgent`. */+ isWorkspaceAgent?: boolean;/*** Messages passed to the client-side runner.* Typically the current conversation messages plus a virtual instruction@@ -78,6 +80,7 @@ export async function dispatchNonHeteroSubAgent(boundDeviceId: ctx.boundDeviceId,heterogeneousProvider: ctx.heterogeneousProvider,isGatewayMode: ctx.isGatewayMode,+ isWorkspaceAgent: ctx.isWorkspaceAgent,parentRuntime: ctx.parentRuntime,});diff --git a/src/store/chat/slices/agentRun/actions/entries/conversationLifecycle.ts b/src/store/chat/slices/agentRun/actions/entries/conversationLifecycle.tsindex 6f6fbe11858..a1583304946 100644--- a/src/store/chat/slices/agentRun/actions/entries/conversationLifecycle.ts+++ b/src/store/chat/slices/agentRun/actions/entries/conversationLifecycle.ts@@ -273,6 +273,7 @@ export class ConversationLifecycleActionImpl {executionTarget: agentConfig?.agencyConfig?.executionTarget,heterogeneousProvider,isGatewayMode: this.#get().isGatewayModeEnabled(agentId),+ isWorkspaceAgent: agentByIdSelectors.isWorkspaceAgentById(agentId)(getAgentStoreState()),// Callers that need to pin the runtime (e.g. task topics that were// started server-side via runTask) pass `forceRuntime` to override// the agent's local/cloud preference.@@ -1599,6 +1600,9 @@ export class ConversationLifecycleActionImpl {heterogeneousProvider: parentAgentConfig?.agencyConfig?.heterogeneousProvider,inPortalThread,isGatewayMode: this.#get().isGatewayModeEnabled(context.agentId),+ isWorkspaceAgent: context.agentId+ ? agentByIdSelectors.isWorkspaceAgentById(context.agentId)(getAgentStoreState())+ : false,messages: messagesWithInstruction,parentOperationId: operationId,},