@lobehub/lobehub 2.0.0-next.306 → 2.0.0-next.308

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (254) hide show
  1. package/.vscode/settings.json +18 -3
  2. package/CHANGELOG.md +61 -0
  3. package/changelog/v1.json +21 -0
  4. package/locales/ar/agentGroup.json +5 -0
  5. package/locales/ar/chat.json +26 -0
  6. package/locales/ar/models.json +43 -5
  7. package/locales/ar/plugin.json +4 -5
  8. package/locales/ar/setting.json +11 -0
  9. package/locales/ar/subscription.json +2 -0
  10. package/locales/ar/tool.json +2 -0
  11. package/locales/bg-BG/agentGroup.json +5 -0
  12. package/locales/bg-BG/chat.json +26 -0
  13. package/locales/bg-BG/models.json +49 -3
  14. package/locales/bg-BG/plugin.json +4 -5
  15. package/locales/bg-BG/setting.json +11 -0
  16. package/locales/bg-BG/subscription.json +2 -0
  17. package/locales/bg-BG/tool.json +2 -0
  18. package/locales/de-DE/agentGroup.json +5 -0
  19. package/locales/de-DE/chat.json +26 -0
  20. package/locales/de-DE/models.json +48 -5
  21. package/locales/de-DE/plugin.json +4 -5
  22. package/locales/de-DE/setting.json +11 -0
  23. package/locales/de-DE/subscription.json +2 -0
  24. package/locales/de-DE/tool.json +2 -0
  25. package/locales/en-US/models.json +8 -6
  26. package/locales/en-US/plugin.json +2 -4
  27. package/locales/en-US/setting.json +10 -11
  28. package/locales/en-US/tool.json +2 -0
  29. package/locales/es-ES/agentGroup.json +5 -0
  30. package/locales/es-ES/chat.json +26 -0
  31. package/locales/es-ES/models.json +43 -5
  32. package/locales/es-ES/plugin.json +4 -5
  33. package/locales/es-ES/setting.json +11 -0
  34. package/locales/es-ES/subscription.json +2 -0
  35. package/locales/es-ES/tool.json +2 -0
  36. package/locales/fa-IR/agentGroup.json +5 -0
  37. package/locales/fa-IR/chat.json +26 -0
  38. package/locales/fa-IR/models.json +42 -5
  39. package/locales/fa-IR/plugin.json +4 -5
  40. package/locales/fa-IR/setting.json +11 -0
  41. package/locales/fa-IR/subscription.json +2 -0
  42. package/locales/fa-IR/tool.json +2 -0
  43. package/locales/fr-FR/agentGroup.json +5 -0
  44. package/locales/fr-FR/chat.json +26 -0
  45. package/locales/fr-FR/models.json +5 -5
  46. package/locales/fr-FR/plugin.json +4 -5
  47. package/locales/fr-FR/setting.json +11 -0
  48. package/locales/fr-FR/subscription.json +2 -0
  49. package/locales/fr-FR/tool.json +2 -0
  50. package/locales/it-IT/agentGroup.json +5 -0
  51. package/locales/it-IT/chat.json +26 -0
  52. package/locales/it-IT/models.json +1 -3
  53. package/locales/it-IT/plugin.json +4 -5
  54. package/locales/it-IT/setting.json +11 -0
  55. package/locales/it-IT/subscription.json +2 -0
  56. package/locales/it-IT/tool.json +2 -0
  57. package/locales/ja-JP/agentGroup.json +5 -0
  58. package/locales/ja-JP/chat.json +26 -0
  59. package/locales/ja-JP/models.json +1 -5
  60. package/locales/ja-JP/plugin.json +4 -5
  61. package/locales/ja-JP/setting.json +11 -0
  62. package/locales/ja-JP/subscription.json +2 -0
  63. package/locales/ja-JP/tool.json +2 -0
  64. package/locales/ko-KR/agentGroup.json +5 -0
  65. package/locales/ko-KR/chat.json +26 -0
  66. package/locales/ko-KR/models.json +1 -3
  67. package/locales/ko-KR/plugin.json +4 -5
  68. package/locales/ko-KR/setting.json +11 -0
  69. package/locales/ko-KR/subscription.json +2 -0
  70. package/locales/ko-KR/tool.json +2 -0
  71. package/locales/nl-NL/agentGroup.json +5 -0
  72. package/locales/nl-NL/chat.json +26 -0
  73. package/locales/nl-NL/models.json +35 -3
  74. package/locales/nl-NL/plugin.json +4 -5
  75. package/locales/nl-NL/setting.json +11 -0
  76. package/locales/nl-NL/subscription.json +2 -0
  77. package/locales/nl-NL/tool.json +2 -0
  78. package/locales/pl-PL/agentGroup.json +5 -0
  79. package/locales/pl-PL/chat.json +26 -0
  80. package/locales/pl-PL/models.json +1 -3
  81. package/locales/pl-PL/plugin.json +4 -5
  82. package/locales/pl-PL/setting.json +11 -0
  83. package/locales/pl-PL/subscription.json +2 -0
  84. package/locales/pl-PL/tool.json +2 -0
  85. package/locales/pt-BR/agentGroup.json +5 -0
  86. package/locales/pt-BR/chat.json +26 -0
  87. package/locales/pt-BR/models.json +50 -5
  88. package/locales/pt-BR/plugin.json +4 -5
  89. package/locales/pt-BR/setting.json +11 -0
  90. package/locales/pt-BR/subscription.json +2 -0
  91. package/locales/pt-BR/tool.json +2 -0
  92. package/locales/ru-RU/agentGroup.json +5 -0
  93. package/locales/ru-RU/chat.json +26 -0
  94. package/locales/ru-RU/models.json +22 -3
  95. package/locales/ru-RU/plugin.json +4 -5
  96. package/locales/ru-RU/setting.json +11 -0
  97. package/locales/ru-RU/subscription.json +2 -0
  98. package/locales/ru-RU/tool.json +2 -0
  99. package/locales/tr-TR/agentGroup.json +5 -0
  100. package/locales/tr-TR/chat.json +26 -0
  101. package/locales/tr-TR/models.json +36 -3
  102. package/locales/tr-TR/plugin.json +4 -5
  103. package/locales/tr-TR/setting.json +11 -0
  104. package/locales/tr-TR/subscription.json +2 -0
  105. package/locales/tr-TR/tool.json +2 -0
  106. package/locales/vi-VN/agentGroup.json +5 -0
  107. package/locales/vi-VN/chat.json +26 -0
  108. package/locales/vi-VN/models.json +1 -1
  109. package/locales/vi-VN/plugin.json +4 -5
  110. package/locales/vi-VN/setting.json +11 -0
  111. package/locales/vi-VN/subscription.json +2 -0
  112. package/locales/vi-VN/tool.json +2 -0
  113. package/locales/zh-CN/models.json +52 -5
  114. package/locales/zh-CN/plugin.json +5 -7
  115. package/locales/zh-CN/setting.json +10 -11
  116. package/locales/zh-CN/tool.json +2 -2
  117. package/locales/zh-TW/agentGroup.json +5 -0
  118. package/locales/zh-TW/chat.json +26 -0
  119. package/locales/zh-TW/models.json +54 -5
  120. package/locales/zh-TW/plugin.json +4 -5
  121. package/locales/zh-TW/setting.json +11 -0
  122. package/locales/zh-TW/subscription.json +2 -0
  123. package/locales/zh-TW/tool.json +2 -0
  124. package/package.json +2 -2
  125. package/packages/builtin-agents/src/agents/group-supervisor/index.ts +1 -7
  126. package/packages/builtin-tool-group-agent-builder/src/ExecutionRuntime/index.ts +29 -0
  127. package/packages/builtin-tool-group-agent-builder/src/executor.ts +18 -0
  128. package/packages/builtin-tool-group-agent-builder/src/manifest.ts +17 -0
  129. package/packages/builtin-tool-group-agent-builder/src/types.ts +10 -0
  130. package/packages/builtin-tool-group-management/src/client/Inspector/ExecuteAgentTask/index.tsx +52 -8
  131. package/packages/builtin-tool-group-management/src/client/Render/ExecuteTask/index.tsx +2 -21
  132. package/packages/builtin-tool-group-management/src/executor.test.ts +6 -16
  133. package/packages/builtin-tool-group-management/src/executor.ts +8 -47
  134. package/packages/builtin-tool-group-management/src/manifest.ts +5 -18
  135. package/packages/builtin-tool-group-management/src/systemRole.ts +1 -8
  136. package/packages/builtin-tool-group-management/src/types.ts +2 -10
  137. package/packages/builtin-tool-local-system/src/ExecutionRuntime/index.ts +70 -31
  138. package/packages/builtin-tool-local-system/src/client/Render/WriteFile/index.tsx +48 -5
  139. package/packages/builtin-tool-local-system/src/client/Streaming/WriteFile/index.tsx +39 -0
  140. package/packages/builtin-tool-local-system/src/client/Streaming/index.ts +2 -0
  141. package/packages/builtin-tool-local-system/src/executor/index.ts +94 -60
  142. package/packages/database/src/repositories/agentGroup/index.ts +23 -0
  143. package/packages/model-bank/src/aiModels/qiniu.ts +24 -0
  144. package/packages/prompts/src/prompts/fileSystem/formatCommandOutput.test.ts +61 -0
  145. package/packages/prompts/src/prompts/fileSystem/formatCommandOutput.ts +21 -0
  146. package/packages/prompts/src/prompts/fileSystem/formatCommandResult.test.ts +87 -0
  147. package/packages/prompts/src/prompts/fileSystem/formatCommandResult.ts +35 -0
  148. package/packages/prompts/src/prompts/fileSystem/formatEditResult.test.ts +57 -0
  149. package/packages/prompts/src/prompts/fileSystem/formatEditResult.ts +17 -0
  150. package/packages/prompts/src/prompts/fileSystem/formatFileContent.test.ts +59 -0
  151. package/packages/prompts/src/prompts/fileSystem/formatFileContent.ts +14 -0
  152. package/packages/prompts/src/prompts/fileSystem/formatFileList.test.ts +62 -0
  153. package/packages/prompts/src/prompts/fileSystem/formatFileList.ts +13 -0
  154. package/packages/prompts/src/prompts/fileSystem/formatFileSearchResults.test.ts +34 -0
  155. package/packages/prompts/src/prompts/fileSystem/formatFileSearchResults.ts +12 -0
  156. package/packages/prompts/src/prompts/fileSystem/formatGlobResults.test.ts +64 -0
  157. package/packages/prompts/src/prompts/fileSystem/formatGlobResults.ts +23 -0
  158. package/packages/prompts/src/prompts/fileSystem/formatGrepResults.test.ts +85 -0
  159. package/packages/prompts/src/prompts/fileSystem/formatGrepResults.ts +24 -0
  160. package/packages/prompts/src/prompts/fileSystem/formatKillResult.test.ts +30 -0
  161. package/packages/prompts/src/prompts/fileSystem/formatKillResult.ts +9 -0
  162. package/packages/prompts/src/prompts/fileSystem/formatMoveResults.test.ts +37 -0
  163. package/packages/prompts/src/prompts/fileSystem/formatMoveResults.ts +20 -0
  164. package/packages/prompts/src/prompts/fileSystem/formatMultipleFiles.test.ts +54 -0
  165. package/packages/prompts/src/prompts/fileSystem/formatMultipleFiles.ts +9 -0
  166. package/packages/prompts/src/prompts/fileSystem/formatRenameResult.test.ts +35 -0
  167. package/packages/prompts/src/prompts/fileSystem/formatRenameResult.ts +17 -0
  168. package/packages/prompts/src/prompts/fileSystem/formatWriteResult.test.ts +30 -0
  169. package/packages/prompts/src/prompts/fileSystem/formatWriteResult.ts +11 -0
  170. package/packages/prompts/src/prompts/fileSystem/index.ts +13 -0
  171. package/packages/prompts/src/prompts/index.ts +1 -0
  172. package/src/app/[variants]/(auth)/_layout/index.tsx +0 -2
  173. package/src/app/[variants]/(auth)/layout.tsx +0 -2
  174. package/src/app/[variants]/(auth)/login/[[...login]]/page.tsx +1 -3
  175. package/src/app/[variants]/(auth)/signup/[[...signup]]/page.tsx +1 -3
  176. package/src/app/[variants]/(desktop)/desktop-onboarding/_layout/index.tsx +0 -2
  177. package/src/app/[variants]/(main)/_layout/index.tsx +0 -2
  178. package/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/Actions.tsx +4 -3
  179. package/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/useDropdownMenu.tsx +12 -2
  180. package/src/app/[variants]/(main)/agent/_layout/index.tsx +0 -2
  181. package/src/app/[variants]/(main)/agent/features/Portal/index.tsx +0 -2
  182. package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Sidebar/ActionButton/AddGroupAgent.tsx +69 -17
  183. package/src/app/[variants]/(main)/community/(list)/_layout/index.tsx +0 -2
  184. package/src/app/[variants]/(main)/community/(list)/assistant/_layout/index.tsx +0 -2
  185. package/src/app/[variants]/(main)/community/(list)/mcp/_layout/index.tsx +0 -2
  186. package/src/app/[variants]/(main)/community/(list)/model/_layout/index.tsx +0 -2
  187. package/src/app/[variants]/(main)/community/_layout/index.tsx +0 -2
  188. package/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/Actions.tsx +4 -3
  189. package/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/useDropdownMenu.tsx +12 -2
  190. package/src/app/[variants]/(main)/group/_layout/index.tsx +0 -2
  191. package/src/app/[variants]/(main)/group/features/Conversation/Header/index.tsx +4 -2
  192. package/src/app/[variants]/(main)/group/features/Portal/index.tsx +0 -2
  193. package/src/app/[variants]/(main)/home/_layout/index.tsx +0 -2
  194. package/src/app/[variants]/(main)/home/index.tsx +0 -2
  195. package/src/app/[variants]/(main)/image/_layout/Topics/TopicUrlSync.tsx +0 -2
  196. package/src/app/[variants]/(main)/image/_layout/index.tsx +0 -2
  197. package/src/app/[variants]/(main)/memory/_layout/index.tsx +0 -2
  198. package/src/app/[variants]/(main)/page/_layout/index.tsx +0 -2
  199. package/src/app/[variants]/(main)/resource/(home)/_layout/index.tsx +0 -2
  200. package/src/app/[variants]/(main)/resource/_layout/index.tsx +0 -2
  201. package/src/app/[variants]/(main)/resource/library/_layout/index.tsx +0 -2
  202. package/src/app/[variants]/(main)/resource/library/features/Container.tsx +0 -2
  203. package/src/app/[variants]/(main)/settings/_layout/index.tsx +0 -2
  204. package/src/app/[variants]/(main)/settings/about/index.tsx +0 -2
  205. package/src/app/[variants]/(main)/settings/agent/index.tsx +0 -2
  206. package/src/app/[variants]/(main)/settings/apikey/index.tsx +0 -2
  207. package/src/app/[variants]/(main)/settings/chat-appearance/index.tsx +0 -2
  208. package/src/app/[variants]/(main)/settings/common/index.tsx +0 -2
  209. package/src/app/[variants]/(main)/settings/hotkey/index.tsx +0 -2
  210. package/src/app/[variants]/(main)/settings/image/index.tsx +0 -2
  211. package/src/app/[variants]/(main)/settings/memory/index.tsx +0 -2
  212. package/src/app/[variants]/(main)/settings/provider/(list)/index.tsx +0 -2
  213. package/src/app/[variants]/(main)/settings/proxy/index.tsx +0 -2
  214. package/src/app/[variants]/(main)/settings/security/index.tsx +1 -3
  215. package/src/app/[variants]/(main)/settings/storage/index.tsx +0 -2
  216. package/src/app/[variants]/(main)/settings/tts/index.tsx +0 -2
  217. package/src/app/[variants]/(mobile)/(home)/_layout/index.tsx +0 -2
  218. package/src/app/[variants]/(mobile)/_layout/index.tsx +1 -3
  219. package/src/app/[variants]/(mobile)/chat/_layout/index.tsx +0 -2
  220. package/src/app/[variants]/(mobile)/chat/settings/_layout/index.tsx +0 -2
  221. package/src/app/[variants]/(mobile)/community/(detail)/_layout/index.tsx +0 -2
  222. package/src/app/[variants]/(mobile)/community/(list)/_layout/index.tsx +0 -2
  223. package/src/app/[variants]/(mobile)/community/_layout/index.tsx +0 -2
  224. package/src/app/[variants]/(mobile)/router/MobileClientRouter.tsx +0 -2
  225. package/src/app/[variants]/(mobile)/settings/index.tsx +0 -2
  226. package/src/app/[variants]/onboarding/_layout/index.tsx +0 -2
  227. package/src/app/[variants]/router/DesktopClientRouter.tsx +0 -2
  228. package/src/components/ModelSelect/index.tsx +6 -56
  229. package/src/components/server/MobileNavLayout.tsx +0 -2
  230. package/src/components/server/ServerLayout.tsx +0 -2
  231. package/src/features/ChatInput/ActionBar/Upload/ServerMode.tsx +13 -3
  232. package/src/features/ChatInput/ActionBar/components/ActionDropdown.tsx +26 -3
  233. package/src/features/ModelSwitchPanel/components/Footer.tsx +0 -2
  234. package/src/features/ModelSwitchPanel/components/List/MultipleProvidersModelItem.tsx +0 -1
  235. package/src/features/ModelSwitchPanel/components/List/SingleProviderModelItem.tsx +0 -1
  236. package/src/features/ModelSwitchPanel/components/List/VirtualItemRenderer.tsx +0 -1
  237. package/src/features/ModelSwitchPanel/components/List/index.tsx +15 -13
  238. package/src/features/ModelSwitchPanel/components/PanelContent.tsx +0 -2
  239. package/src/features/ModelSwitchPanel/index.tsx +21 -23
  240. package/src/features/ResourceManager/components/Explorer/MasonryView/index.tsx +0 -2
  241. package/src/features/ResourceManager/components/Header/AddButton.tsx +20 -3
  242. package/src/features/User/UserAvatar.tsx +0 -2
  243. package/src/locales/default/plugin.ts +2 -1
  244. package/src/server/routers/lambda/__tests__/agentGroup.test.ts +1 -0
  245. package/src/server/routers/lambda/agentGroup.ts +22 -0
  246. package/src/services/chat/index.ts +1 -0
  247. package/src/services/chat/mecha/agentConfigResolver.test.ts +62 -45
  248. package/src/services/chat/mecha/agentConfigResolver.ts +29 -27
  249. package/src/services/chatGroup/index.ts +14 -0
  250. package/src/store/chat/agents/GroupOrchestration/__tests__/call-supervisor.test.ts +305 -0
  251. package/src/store/chat/agents/GroupOrchestration/createGroupOrchestrationExecutors.ts +2 -1
  252. package/src/store/chat/slices/aiChat/actions/streamingExecutor.ts +6 -2
  253. package/src/store/chat/slices/plugin/actions/exector.ts +92 -0
  254. package/src/store/chat/slices/plugin/actions/pluginTypes.ts +82 -177
@@ -0,0 +1,35 @@
1
+ import { describe, expect, it } from 'vitest';
2
+
3
+ import { formatRenameResult } from './formatRenameResult';
4
+
5
+ describe('formatRenameResult', () => {
6
+ it('should format successful rename', () => {
7
+ const result = formatRenameResult({
8
+ newName: 'newFile.ts',
9
+ oldPath: '/src/oldFile.ts',
10
+ success: true,
11
+ });
12
+ expect(result).toMatchInlineSnapshot(
13
+ `"Successfully renamed file /src/oldFile.ts to newFile.ts"`,
14
+ );
15
+ });
16
+
17
+ it('should format failed rename', () => {
18
+ const result = formatRenameResult({
19
+ error: 'File already exists',
20
+ newName: 'existing.ts',
21
+ oldPath: '/src/file.ts',
22
+ success: false,
23
+ });
24
+ expect(result).toMatchInlineSnapshot(`"Failed to rename file: File already exists"`);
25
+ });
26
+
27
+ it('should format failed rename without error message', () => {
28
+ const result = formatRenameResult({
29
+ newName: 'newName.ts',
30
+ oldPath: '/src/file.ts',
31
+ success: false,
32
+ });
33
+ expect(result).toMatchInlineSnapshot(`"Failed to rename file: undefined"`);
34
+ });
35
+ });
@@ -0,0 +1,17 @@
1
+ export interface FormatRenameResultParams {
2
+ error?: string;
3
+ newName: string;
4
+ oldPath: string;
5
+ success: boolean;
6
+ }
7
+
8
+ export const formatRenameResult = ({
9
+ success,
10
+ oldPath,
11
+ newName,
12
+ error,
13
+ }: FormatRenameResultParams): string => {
14
+ return success
15
+ ? `Successfully renamed file ${oldPath} to ${newName}`
16
+ : `Failed to rename file: ${error}`;
17
+ };
@@ -0,0 +1,30 @@
1
+ import { describe, expect, it } from 'vitest';
2
+
3
+ import { formatWriteResult } from './formatWriteResult';
4
+
5
+ describe('formatWriteResult', () => {
6
+ it('should format successful write', () => {
7
+ const result = formatWriteResult({
8
+ path: '/src/newFile.ts',
9
+ success: true,
10
+ });
11
+ expect(result).toMatchInlineSnapshot(`"Successfully wrote to /src/newFile.ts"`);
12
+ });
13
+
14
+ it('should format failed write with error', () => {
15
+ const result = formatWriteResult({
16
+ error: 'Permission denied',
17
+ path: '/protected/file.ts',
18
+ success: false,
19
+ });
20
+ expect(result).toMatchInlineSnapshot(`"Failed to write file: Permission denied"`);
21
+ });
22
+
23
+ it('should format failed write without error message', () => {
24
+ const result = formatWriteResult({
25
+ path: '/some/path.ts',
26
+ success: false,
27
+ });
28
+ expect(result).toMatchInlineSnapshot(`"Failed to write file: Unknown error"`);
29
+ });
30
+ });
@@ -0,0 +1,11 @@
1
+ export interface FormatWriteResultParams {
2
+ error?: string;
3
+ path: string;
4
+ success: boolean;
5
+ }
6
+
7
+ export const formatWriteResult = ({ success, path, error }: FormatWriteResultParams): string => {
8
+ return success
9
+ ? `Successfully wrote to ${path}`
10
+ : `Failed to write file: ${error || 'Unknown error'}`;
11
+ };
@@ -0,0 +1,13 @@
1
+ export * from './formatCommandOutput';
2
+ export * from './formatCommandResult';
3
+ export * from './formatEditResult';
4
+ export * from './formatFileContent';
5
+ export * from './formatFileList';
6
+ export * from './formatFileSearchResults';
7
+ export * from './formatGlobResults';
8
+ export * from './formatGrepResults';
9
+ export * from './formatKillResult';
10
+ export * from './formatMoveResults';
11
+ export * from './formatMultipleFiles';
12
+ export * from './formatRenameResult';
13
+ export * from './formatWriteResult';
@@ -2,6 +2,7 @@ export * from './agentBuilder';
2
2
  export * from './agentGroup';
3
3
  export * from './chatMessages';
4
4
  export * from './files';
5
+ export * from './fileSystem';
5
6
  export * from './groupChat';
6
7
  export * from './gtd';
7
8
  export * from './knowledgeBaseQA';
@@ -49,6 +49,4 @@ const AuthContainer: FC<PropsWithChildren> = ({ children }) => {
49
49
  );
50
50
  };
51
51
 
52
- AuthContainer.displayName = 'AuthContainer';
53
-
54
52
  export default AuthContainer;
@@ -15,6 +15,4 @@ const AuthLayout: FC<PropsWithChildren> = ({ children }) => {
15
15
  );
16
16
  };
17
17
 
18
- AuthLayout.displayName = 'AuthLayout';
19
-
20
18
  export default AuthLayout;
@@ -1,8 +1,8 @@
1
1
  import { SignIn } from '@clerk/nextjs';
2
2
  import { BRANDING_NAME } from '@lobechat/business-const';
3
- import { notFound } from '@/libs/next/navigation';
4
3
 
5
4
  import { enableClerk } from '@/envs/auth';
5
+ import { notFound } from '@/libs/next/navigation';
6
6
  import { metadataModule } from '@/server/metadata';
7
7
  import { translation } from '@/server/translation';
8
8
  import { type DynamicLayoutProps } from '@/types/next';
@@ -24,6 +24,4 @@ const Page = () => {
24
24
  return <SignIn path="/login" />;
25
25
  };
26
26
 
27
- Page.displayName = 'Login';
28
-
29
27
  export default Page;
@@ -1,7 +1,7 @@
1
1
  import { SignUp } from '@clerk/nextjs';
2
- import { notFound } from '@/libs/next/navigation';
3
2
 
4
3
  import { enableBetterAuth, enableClerk } from '@/envs/auth';
4
+ import { notFound } from '@/libs/next/navigation';
5
5
  import { metadataModule } from '@/server/metadata';
6
6
  import { translation } from '@/server/translation';
7
7
  import { type DynamicLayoutProps } from '@/types/next';
@@ -48,6 +48,4 @@ const Page = () => {
48
48
  return notFound();
49
49
  };
50
50
 
51
- Page.displayName = 'SignUp';
52
-
53
51
  export default Page;
@@ -58,6 +58,4 @@ const OnboardingContainer: FC<PropsWithChildren> = ({ children }) => {
58
58
  );
59
59
  };
60
60
 
61
- OnboardingContainer.displayName = 'OnboardingContainer';
62
-
63
61
  export default OnboardingContainer;
@@ -89,6 +89,4 @@ const Layout: FC = () => {
89
89
  );
90
90
  };
91
91
 
92
- Layout.displayName = 'DesktopMainLayout';
93
-
94
92
  export default Layout;
@@ -1,14 +1,15 @@
1
1
  import { ActionIcon, DropdownMenu } from '@lobehub/ui';
2
2
  import { MoreHorizontal } from 'lucide-react';
3
- import { memo } from 'react';
3
+ import { memo, useState } from 'react';
4
4
 
5
5
  import { useTopicActionsDropdownMenu } from './useDropdownMenu';
6
6
 
7
7
  const Actions = memo(() => {
8
- const menuItems = useTopicActionsDropdownMenu();
8
+ const [open, setOpen] = useState(false);
9
+ const menuItems = useTopicActionsDropdownMenu({ onUploadClose: () => setOpen(false) });
9
10
 
10
11
  return (
11
- <DropdownMenu items={menuItems}>
12
+ <DropdownMenu items={menuItems} onOpenChange={setOpen} open={open}>
12
13
  <ActionIcon icon={MoreHorizontal} size={'small'} />
13
14
  </DropdownMenu>
14
15
  );
@@ -21,9 +21,16 @@ const hotArea = css`
21
21
  }
22
22
  `;
23
23
 
24
- export const useTopicActionsDropdownMenu = (): MenuProps['items'] => {
24
+ interface UseTopicActionsDropdownMenuOptions {
25
+ onUploadClose?: () => void;
26
+ }
27
+
28
+ export const useTopicActionsDropdownMenu = (
29
+ options: UseTopicActionsDropdownMenuOptions = {},
30
+ ): MenuProps['items'] => {
25
31
  const { t } = useTranslation(['topic', 'common']);
26
32
  const { modal } = App.useApp();
33
+ const { onUploadClose } = options;
27
34
 
28
35
  const [removeUnstarredTopic, removeAllTopic, importTopic] = useChatStore((s) => [
29
36
  s.removeUnstarredTopic,
@@ -33,6 +40,7 @@ export const useTopicActionsDropdownMenu = (): MenuProps['items'] => {
33
40
 
34
41
  const handleImport = useCallback(
35
42
  async (file: File) => {
43
+ onUploadClose?.();
36
44
  try {
37
45
  const text = await file.text();
38
46
  // Validate JSON format
@@ -46,7 +54,7 @@ export const useTopicActionsDropdownMenu = (): MenuProps['items'] => {
46
54
  }
47
55
  return false; // Prevent default upload behavior
48
56
  },
49
- [importTopic, modal, t],
57
+ [importTopic, modal, onUploadClose, t],
50
58
  );
51
59
 
52
60
  const [topicDisplayMode, updatePreference] = useUserStore((s) => [
@@ -101,6 +109,7 @@ export const useTopicActionsDropdownMenu = (): MenuProps['items'] => {
101
109
  <div className={cx(hotArea)}>{t('actions.import')}</div>
102
110
  </Upload>
103
111
  ),
112
+ ...(onUploadClose ? { closeOnClick: false } : null),
104
113
  },
105
114
  {
106
115
  type: 'divider' as const,
@@ -143,6 +152,7 @@ export const useTopicActionsDropdownMenu = (): MenuProps['items'] => {
143
152
  updatePreference,
144
153
  updateSystemStatus,
145
154
  handleImport,
155
+ onUploadClose,
146
156
  removeUnstarredTopic,
147
157
  removeAllTopic,
148
158
  t,
@@ -30,6 +30,4 @@ const Layout: FC = () => {
30
30
  );
31
31
  };
32
32
 
33
- Layout.displayName = 'DesktopChatLayout';
34
-
35
33
  export default Layout;
@@ -15,6 +15,4 @@ const ChatPortal = () => {
15
15
  );
16
16
  };
17
17
 
18
- ChatPortal.displayName = 'ChatPortal';
19
-
20
18
  export default ChatPortal;
@@ -87,6 +87,42 @@ const AddGroupAgent = memo<{ mobile?: boolean }>(() => {
87
87
  return;
88
88
  }
89
89
 
90
+ // Find supervisor from memberAgents
91
+ const supervisorMember = memberAgents.find((member: any) => {
92
+ const agent = member.agent || member;
93
+ const role = member.role || agent.role;
94
+ return role === 'supervisor';
95
+ });
96
+
97
+ // Prepare supervisor config
98
+ let supervisorConfig;
99
+ if (supervisorMember) {
100
+ // Type assertion needed because actual API data structure differs from type definition
101
+ const member = supervisorMember as any;
102
+ const agent = member.agent || member;
103
+ const currentVersion = member.currentVersion || member;
104
+ const rawConfig = {
105
+ avatar: currentVersion.avatar,
106
+ backgroundColor: currentVersion.backgroundColor,
107
+ description: currentVersion.description,
108
+ model: currentVersion.config?.model || currentVersion.model,
109
+ params: currentVersion.config?.params || currentVersion.params,
110
+ provider: currentVersion.config?.provider || currentVersion.provider,
111
+ systemRole:
112
+ currentVersion.config?.systemRole ||
113
+ currentVersion.config?.systemPrompt ||
114
+ currentVersion.systemRole ||
115
+ currentVersion.content,
116
+ tags: currentVersion.tags,
117
+ title: currentVersion.name || agent.name || 'Supervisor',
118
+ };
119
+ // Filter out null/undefined values
120
+ supervisorConfig = Object.fromEntries(
121
+ // eslint-disable-next-line eqeqeq, @typescript-eslint/no-unused-vars
122
+ Object.entries(rawConfig).filter(([_, v]) => v != null),
123
+ );
124
+ }
125
+
90
126
  // Prepare group config
91
127
  const groupConfig = {
92
128
  config: {
@@ -95,30 +131,46 @@ const AddGroupAgent = memo<{ mobile?: boolean }>(() => {
95
131
  openingQuestions: config.openingQuestions,
96
132
  revealDM: config.revealDM,
97
133
  },
98
- content: config.systemRole,
134
+ // Group content is the supervisor's systemRole (for backward compatibility)
135
+ content: supervisorConfig?.systemRole || config.systemRole,
99
136
  ...meta,
100
137
  };
101
138
 
102
139
  // Prepare member agents from market data
103
- const members = memberAgents.map((member: any) => {
104
- const agent = member.agent || member;
105
- const currentVersion = member.currentVersion || member;
106
- return {
107
- avatar: currentVersion.avatar,
108
- backgroundColor: currentVersion.backgroundColor,
109
- description: currentVersion.description,
110
- model: currentVersion.model,
111
- plugins: currentVersion.plugins,
112
- provider: currentVersion.provider,
113
- systemRole: currentVersion.systemRole || currentVersion.content,
114
- tags: currentVersion.tags,
115
- title: currentVersion.name || agent.name,
116
- };
117
- });
140
+ // Filter out supervisor role as it will be created separately using supervisorConfig
141
+ const members = memberAgents
142
+ .filter((member: any) => {
143
+ const agent = member.agent || member;
144
+ const role = member.role || agent.role;
145
+ return role !== 'supervisor';
146
+ })
147
+ .map((member: any) => {
148
+ const agent = member.agent || member;
149
+ const currentVersion = member.currentVersion || member;
150
+ return {
151
+ avatar: currentVersion.avatar,
152
+ backgroundColor: currentVersion.backgroundColor,
153
+ description: currentVersion.description,
154
+ model: currentVersion.config?.model || currentVersion.model,
155
+ plugins: currentVersion.plugins,
156
+ provider: currentVersion.config?.provider || currentVersion.provider,
157
+ systemRole:
158
+ currentVersion.config?.systemRole ||
159
+ currentVersion.config?.systemPrompt ||
160
+ currentVersion.systemRole ||
161
+ currentVersion.content,
162
+ tags: currentVersion.tags,
163
+ title: currentVersion.name || agent.name,
164
+ };
165
+ });
118
166
 
119
167
  try {
120
168
  // Create group with all members in one request
121
- const result = await chatGroupService.createGroupWithMembers(groupConfig, members);
169
+ const result = await chatGroupService.createGroupWithMembers(
170
+ groupConfig,
171
+ members,
172
+ supervisorConfig,
173
+ );
122
174
 
123
175
  // Refresh group list
124
176
  await loadGroups();
@@ -32,6 +32,4 @@ const Layout = () => {
32
32
  );
33
33
  };
34
34
 
35
- Layout.displayName = 'DesktopDiscoverStoreLayout';
36
-
37
35
  export default Layout;
@@ -18,6 +18,4 @@ const Layout = () => {
18
18
  );
19
19
  };
20
20
 
21
- Layout.displayName = 'DesktopDiscoverAssistantsLayout';
22
-
23
21
  export default Layout;
@@ -18,6 +18,4 @@ const Layout = () => {
18
18
  );
19
19
  };
20
20
 
21
- Layout.displayName = 'DesktopDiscoverToolsLayout';
22
-
23
21
  export default Layout;
@@ -18,6 +18,4 @@ const Layout = () => {
18
18
  );
19
19
  };
20
20
 
21
- Layout.displayName = 'DesktopDiscoverModelsLayout';
22
-
23
21
  export default Layout;
@@ -19,6 +19,4 @@ const Layout: FC = () => {
19
19
  );
20
20
  };
21
21
 
22
- Layout.displayName = 'DesktopDiscoverStoreLayout';
23
-
24
22
  export default Layout;
@@ -1,14 +1,15 @@
1
1
  import { ActionIcon, DropdownMenu } from '@lobehub/ui';
2
2
  import { MoreHorizontal } from 'lucide-react';
3
- import { memo } from 'react';
3
+ import { memo, useState } from 'react';
4
4
 
5
5
  import { useTopicActionsDropdownMenu } from './useDropdownMenu';
6
6
 
7
7
  const Actions = memo(() => {
8
- const menuItems = useTopicActionsDropdownMenu();
8
+ const [open, setOpen] = useState(false);
9
+ const menuItems = useTopicActionsDropdownMenu({ onUploadClose: () => setOpen(false) });
9
10
 
10
11
  return (
11
- <DropdownMenu items={menuItems}>
12
+ <DropdownMenu items={menuItems} onOpenChange={setOpen} open={open}>
12
13
  <ActionIcon icon={MoreHorizontal} size={'small'} />
13
14
  </DropdownMenu>
14
15
  );
@@ -21,9 +21,16 @@ const hotArea = css`
21
21
  }
22
22
  `;
23
23
 
24
- export const useTopicActionsDropdownMenu = (): MenuProps['items'] => {
24
+ interface UseTopicActionsDropdownMenuOptions {
25
+ onUploadClose?: () => void;
26
+ }
27
+
28
+ export const useTopicActionsDropdownMenu = (
29
+ options: UseTopicActionsDropdownMenuOptions = {},
30
+ ): MenuProps['items'] => {
25
31
  const { t } = useTranslation(['topic', 'common']);
26
32
  const { modal } = App.useApp();
33
+ const { onUploadClose } = options;
27
34
 
28
35
  const [removeUnstarredTopic, removeAllTopic, importTopic] = useChatStore((s) => [
29
36
  s.removeUnstarredTopic,
@@ -33,6 +40,7 @@ export const useTopicActionsDropdownMenu = (): MenuProps['items'] => {
33
40
 
34
41
  const handleImport = useCallback(
35
42
  async (file: File) => {
43
+ onUploadClose?.();
36
44
  try {
37
45
  const text = await file.text();
38
46
  // Validate JSON format
@@ -46,7 +54,7 @@ export const useTopicActionsDropdownMenu = (): MenuProps['items'] => {
46
54
  }
47
55
  return false; // Prevent default upload behavior
48
56
  },
49
- [importTopic, modal, t],
57
+ [importTopic, modal, onUploadClose, t],
50
58
  );
51
59
 
52
60
  const [topicDisplayMode, updatePreference] = useUserStore((s) => [
@@ -101,6 +109,7 @@ export const useTopicActionsDropdownMenu = (): MenuProps['items'] => {
101
109
  <div className={cx(hotArea)}>{t('actions.import')}</div>
102
110
  </Upload>
103
111
  ),
112
+ ...(onUploadClose ? { closeOnClick: false } : null),
104
113
  },
105
114
  {
106
115
  type: 'divider' as const,
@@ -143,6 +152,7 @@ export const useTopicActionsDropdownMenu = (): MenuProps['items'] => {
143
152
  updatePreference,
144
153
  updateSystemStatus,
145
154
  handleImport,
155
+ onUploadClose,
146
156
  removeUnstarredTopic,
147
157
  removeAllTopic,
148
158
  t,
@@ -30,6 +30,4 @@ const Layout: FC = () => {
30
30
  );
31
31
  };
32
32
 
33
- Layout.displayName = 'DesktopChatLayout';
34
-
35
33
  export default Layout;
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { Flexbox } from '@lobehub/ui';
4
4
  import { cssVar } from 'antd-style';
5
- import { memo } from 'react';
5
+ import { Suspense, memo } from 'react';
6
6
 
7
7
  import NavHeader from '@/features/NavHeader';
8
8
  import WideScreenButton from '@/features/WideScreenContainer/WideScreenButton';
@@ -15,7 +15,9 @@ const Header = memo(() => {
15
15
  right={
16
16
  <Flexbox horizontal style={{ backgroundColor: cssVar.colorBgContainer }}>
17
17
  <WideScreenButton />
18
- <ShareButton />
18
+ <Suspense>
19
+ <ShareButton />
20
+ </Suspense>
19
21
  </Flexbox>
20
22
  }
21
23
  />
@@ -14,6 +14,4 @@ const ChatPortal = () => {
14
14
  );
15
15
  };
16
16
 
17
- ChatPortal.displayName = 'ChatPortal';
18
-
19
17
  export default ChatPortal;
@@ -64,6 +64,4 @@ const Layout: FC<LayoutProps> = ({ children }) => {
64
64
  );
65
65
  };
66
66
 
67
- Layout.displayName = 'DesktopHomeLayout';
68
-
69
67
  export default Layout;
@@ -26,6 +26,4 @@ const Home: FC = () => {
26
26
  );
27
27
  };
28
28
 
29
- Home.displayName = 'Home';
30
-
31
29
  export default Home;
@@ -32,6 +32,4 @@ const TopicUrlSync = () => {
32
32
  return null;
33
33
  };
34
34
 
35
- TopicUrlSync.displayName = 'TopicUrlSync';
36
-
37
35
  export default TopicUrlSync;
@@ -22,6 +22,4 @@ const Layout: FC = () => {
22
22
  );
23
23
  };
24
24
 
25
- Layout.displayName = 'DesktopAiImageLayout';
26
-
27
25
  export default Layout;
@@ -18,6 +18,4 @@ const DesktopMemoryLayout: FC = () => {
18
18
  );
19
19
  };
20
20
 
21
- DesktopMemoryLayout.displayName = 'DesktopMemoryLayout';
22
-
23
21
  export default DesktopMemoryLayout;
@@ -20,6 +20,4 @@ const DesktopPagesLayout: FC = () => {
20
20
  );
21
21
  };
22
22
 
23
- DesktopPagesLayout.displayName = 'DesktopPagesLayout';
24
-
25
23
  export default DesktopPagesLayout;
@@ -18,6 +18,4 @@ const HomeLayout: FC = () => {
18
18
  );
19
19
  };
20
20
 
21
- HomeLayout.displayName = 'ResourceHomeLayout';
22
-
23
21
  export default HomeLayout;
@@ -14,6 +14,4 @@ const ResourceLayout: FC = () => {
14
14
  );
15
15
  };
16
16
 
17
- ResourceLayout.displayName = 'ResourceLayout';
18
-
19
17
  export default ResourceLayout;
@@ -21,6 +21,4 @@ const LibraryLayout: FC = () => {
21
21
  );
22
22
  };
23
23
 
24
- LibraryLayout.displayName = 'ResourceLibraryLayout';
25
-
26
24
  export default LibraryLayout;
@@ -21,6 +21,4 @@ const Container: FC<PropsWithChildren> = ({ children }) => {
21
21
  );
22
22
  };
23
23
 
24
- Container.displayName = 'Container';
25
-
26
24
  export default Container;
@@ -25,6 +25,4 @@ const Layout: FC = () => {
25
25
  );
26
26
  };
27
27
 
28
- Layout.displayName = 'DesktopSettingsWrapper';
29
-
30
28
  export default Layout;
@@ -16,6 +16,4 @@ const Page = ({ mobile }: { mobile?: boolean }) => {
16
16
  );
17
17
  };
18
18
 
19
- Page.displayName = 'AboutSetting';
20
-
21
19
  export default Page;
@@ -33,6 +33,4 @@ const Page = () => {
33
33
  );
34
34
  };
35
35
 
36
- Page.displayName = 'SystemAgent';
37
-
38
36
  export default Page;
@@ -14,6 +14,4 @@ const Page = () => {
14
14
  );
15
15
  };
16
16
 
17
- Page.displayName = 'ApiKeySetting';
18
-
19
17
  export default Page;
@@ -15,6 +15,4 @@ const Page = () => {
15
15
  );
16
16
  };
17
17
 
18
- Page.displayName = 'ChatAppearanceSetting';
19
-
20
18
  export default Page;