@lobehub/chat 1.32.3 → 1.32.5

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 (79) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.md +8 -8
  3. package/README.zh-CN.md +8 -8
  4. package/locales/ar/models.json +12 -0
  5. package/locales/ar/providers.json +3 -0
  6. package/locales/bg-BG/models.json +12 -0
  7. package/locales/bg-BG/providers.json +3 -0
  8. package/locales/de-DE/models.json +12 -0
  9. package/locales/de-DE/providers.json +3 -0
  10. package/locales/en-US/models.json +12 -0
  11. package/locales/en-US/providers.json +3 -0
  12. package/locales/es-ES/models.json +12 -0
  13. package/locales/es-ES/providers.json +3 -0
  14. package/locales/fa-IR/models.json +12 -0
  15. package/locales/fa-IR/providers.json +3 -0
  16. package/locales/fr-FR/models.json +12 -0
  17. package/locales/fr-FR/providers.json +3 -0
  18. package/locales/it-IT/models.json +12 -0
  19. package/locales/it-IT/providers.json +3 -0
  20. package/locales/ja-JP/models.json +12 -0
  21. package/locales/ja-JP/providers.json +3 -0
  22. package/locales/ko-KR/models.json +12 -0
  23. package/locales/ko-KR/providers.json +3 -0
  24. package/locales/nl-NL/models.json +12 -0
  25. package/locales/nl-NL/providers.json +3 -0
  26. package/locales/pl-PL/models.json +12 -0
  27. package/locales/pl-PL/providers.json +3 -0
  28. package/locales/pt-BR/models.json +12 -0
  29. package/locales/pt-BR/providers.json +3 -0
  30. package/locales/ru-RU/models.json +12 -0
  31. package/locales/ru-RU/providers.json +3 -0
  32. package/locales/tr-TR/models.json +12 -0
  33. package/locales/tr-TR/providers.json +3 -0
  34. package/locales/vi-VN/models.json +12 -0
  35. package/locales/vi-VN/providers.json +3 -0
  36. package/locales/zh-CN/models.json +12 -0
  37. package/locales/zh-CN/providers.json +3 -0
  38. package/locales/zh-TW/models.json +12 -0
  39. package/locales/zh-TW/providers.json +3 -0
  40. package/package.json +2 -2
  41. package/src/app/(main)/chat/(workspace)/@conversation/features/ChatList/ChatItem/index.tsx +39 -0
  42. package/src/app/(main)/chat/(workspace)/@conversation/features/ChatList/Content.tsx +20 -14
  43. package/src/app/(main)/chat/(workspace)/@conversation/features/ChatList/WelcomeChatItem/WelcomeMessage.tsx +44 -0
  44. package/src/app/(main)/chat/(workspace)/@conversation/features/ChatList/WelcomeChatItem/index.tsx +17 -0
  45. package/src/app/(main)/chat/(workspace)/@portal/features/Header.tsx +1 -13
  46. package/src/app/metadata.ts +2 -1
  47. package/src/components/BrandWatermark/index.tsx +1 -0
  48. package/src/const/message.ts +1 -1
  49. package/src/features/Conversation/components/ChatItem/ActionsBar.tsx +9 -13
  50. package/src/features/Conversation/components/ChatItem/index.tsx +183 -209
  51. package/src/features/Conversation/components/VirtualizedList/index.tsx +75 -84
  52. package/src/features/Conversation/index.ts +0 -1
  53. package/src/features/Portal/Artifacts/index.ts +1 -1
  54. package/src/features/Portal/FilePreview/index.ts +1 -1
  55. package/src/features/Portal/Home/{Header.tsx → Title.tsx} +2 -2
  56. package/src/features/Portal/Home/index.ts +1 -1
  57. package/src/features/Portal/MessageDetail/index.ts +1 -1
  58. package/src/features/Portal/Plugins/index.ts +1 -1
  59. package/src/features/Portal/components/Header.tsx +29 -0
  60. package/src/features/Portal/router.tsx +22 -3
  61. package/src/features/Portal/type.ts +3 -1
  62. package/src/features/{Conversation/components → ShareModal/ShareImage}/ChatList/index.tsx +3 -4
  63. package/src/features/ShareModal/ShareImage/Preview.tsx +1 -1
  64. package/src/features/ShareModal/ShareJSON/index.tsx +1 -1
  65. package/src/features/ShareModal/ShareText/index.tsx +1 -1
  66. package/src/layout/GlobalProvider/Debug.tsx +15 -0
  67. package/src/layout/GlobalProvider/index.tsx +4 -2
  68. package/src/locales/resources.ts +5 -2
  69. package/src/server/ld.ts +2 -2
  70. package/src/store/chat/slices/aiChat/actions/generateAIChat.ts +5 -5
  71. package/src/store/chat/slices/message/action.ts +2 -2
  72. package/src/store/chat/slices/message/selectors.test.ts +0 -86
  73. package/src/store/chat/slices/message/selectors.ts +55 -73
  74. package/src/store/chat/slices/plugin/action.test.ts +2 -2
  75. package/src/store/chat/slices/plugin/action.ts +1 -1
  76. package/src/store/chat/slices/topic/action.ts +2 -2
  77. /package/src/{features/Conversation/components → app/(main)/chat/(workspace)/@conversation/features/ChatList/WelcomeChatItem}/InboxWelcome/AgentsSuggest.tsx +0 -0
  78. /package/src/{features/Conversation/components → app/(main)/chat/(workspace)/@conversation/features/ChatList/WelcomeChatItem}/InboxWelcome/QuestionSuggest.tsx +0 -0
  79. /package/src/{features/Conversation/components → app/(main)/chat/(workspace)/@conversation/features/ChatList/WelcomeChatItem}/InboxWelcome/index.tsx +0 -0
@@ -149,7 +149,7 @@ describe('ChatPluginAction', () => {
149
149
  it('should update message content and trigger the ai message', async () => {
150
150
  // 设置模拟函数的返回值
151
151
  const mockCurrentChats: any[] = [];
152
- vi.spyOn(chatSelectors, 'currentChats').mockReturnValue(mockCurrentChats);
152
+ vi.spyOn(chatSelectors, 'activeBaseChats').mockReturnValue(mockCurrentChats);
153
153
 
154
154
  // 设置初始状态
155
155
  const initialState = {
@@ -184,7 +184,7 @@ describe('ChatPluginAction', () => {
184
184
  it('should update message content and not trigger ai message', async () => {
185
185
  // 设置模拟函数的返回值
186
186
  const mockCurrentChats: any[] = [];
187
- vi.spyOn(chatSelectors, 'currentChats').mockReturnValue(mockCurrentChats);
187
+ vi.spyOn(chatSelectors, 'activeBaseChats').mockReturnValue(mockCurrentChats);
188
188
 
189
189
  // 设置初始状态
190
190
  const initialState = {
@@ -202,7 +202,7 @@ export const chatPlugin: StateCreator<
202
202
 
203
203
  triggerAIMessage: async ({ parentId, traceId }) => {
204
204
  const { internal_coreProcessMessage } = get();
205
- const chats = chatSelectors.currentChats(get());
205
+ const chats = chatSelectors.activeBaseChats(get());
206
206
  await internal_coreProcessMessage(chats, parentId ?? chats.at(-1)!.id, { traceId });
207
207
  },
208
208
 
@@ -79,7 +79,7 @@ export const chatTopic: StateCreator<
79
79
  createTopic: async () => {
80
80
  const { activeId, internal_createTopic } = get();
81
81
 
82
- const messages = chatSelectors.currentChats(get());
82
+ const messages = chatSelectors.activeBaseChats(get());
83
83
 
84
84
  set({ creatingTopic: true }, false, n('creatingTopic/start'));
85
85
  const topicId = await internal_createTopic({
@@ -94,7 +94,7 @@ export const chatTopic: StateCreator<
94
94
 
95
95
  saveToTopic: async () => {
96
96
  // if there is no message, stop
97
- const messages = chatSelectors.currentChats(get());
97
+ const messages = chatSelectors.activeBaseChats(get());
98
98
  if (messages.length === 0) return;
99
99
 
100
100
  const { activeId, summaryTopicTitle, internal_createTopic } = get();