@lobehub/chat 0.115.2 → 0.115.4

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 (87) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/package.json +1 -1
  3. package/src/app/chat/features/SessionListContent/DefaultMode.tsx +2 -1
  4. package/src/app/chat/features/SessionListContent/List/Item/index.tsx +2 -1
  5. package/src/app/settings/agent/Agent.tsx +2 -1
  6. package/src/app/settings/common/Common.tsx +2 -1
  7. package/src/app/settings/llm/LLM/Checker.tsx +1 -1
  8. package/src/app/settings/llm/LLM/index.tsx +2 -1
  9. package/src/app/settings/tts/TTS/index.tsx +2 -1
  10. package/src/database/models/__tests__/message.test.ts +1 -1
  11. package/src/database/models/message.ts +1 -1
  12. package/src/features/AgentSetting/AgentConfig/index.tsx +2 -1
  13. package/src/features/AgentSetting/AgentMeta/index.tsx +2 -1
  14. package/src/features/AgentSetting/AgentTTS/SelectWithTTSPreview.tsx +1 -1
  15. package/src/features/AgentSetting/AgentTTS/index.tsx +3 -2
  16. package/src/features/ChatInput/ActionBar/ModelSwitch.tsx +2 -1
  17. package/src/features/ChatInput/STT/index.tsx +1 -1
  18. package/src/features/Conversation/ChatList/Error/ApiKeyForm.tsx +2 -1
  19. package/src/features/Conversation/ChatList/Extras/Assistant.test.tsx +1 -1
  20. package/src/features/Conversation/ChatList/Extras/Assistant.tsx +1 -1
  21. package/src/features/Conversation/ChatList/Extras/TTS/InitPlayer.tsx +1 -1
  22. package/src/features/Conversation/ChatList/Extras/TTS/Player.tsx +1 -1
  23. package/src/features/Conversation/ChatList/Extras/TTS/index.tsx +3 -2
  24. package/src/features/Conversation/ChatList/Extras/Translate.tsx +1 -1
  25. package/src/features/Conversation/ChatList/Extras/User.tsx +1 -1
  26. package/src/features/Conversation/ChatList/Extras/type.ts +1 -1
  27. package/src/features/Conversation/ChatList/Messages/Assistant.tsx +1 -1
  28. package/src/features/Conversation/ChatList/Messages/Default.tsx +1 -1
  29. package/src/features/Conversation/ChatList/Messages/Function.tsx +1 -1
  30. package/src/features/Conversation/ChatList/Messages/User.tsx +1 -1
  31. package/src/features/Conversation/index.tsx +2 -1
  32. package/src/features/PluginDevModal/LocalForm.tsx +3 -2
  33. package/src/hooks/useSTT.ts +2 -1
  34. package/src/hooks/useTTS.ts +2 -1
  35. package/src/services/__tests__/chat.test.ts +1 -1
  36. package/src/services/__tests__/message.test.ts +1 -1
  37. package/src/services/_header.ts +2 -2
  38. package/src/services/chat.ts +1 -1
  39. package/src/services/config.ts +3 -2
  40. package/src/services/message.ts +2 -2
  41. package/src/store/chat/helpers.test.ts +1 -1
  42. package/src/store/chat/helpers.ts +1 -1
  43. package/src/store/chat/initialState.ts +9 -47
  44. package/src/store/chat/selectors.ts +3 -0
  45. package/src/store/chat/{actions/enhance.test.ts → slices/enchance/action.test.ts} +2 -2
  46. package/src/store/chat/{actions/message.test.ts → slices/message/action.test.ts} +2 -2
  47. package/src/store/chat/{actions/message.ts → slices/message/action.ts} +3 -3
  48. package/src/store/chat/slices/message/initialState.ts +29 -0
  49. package/src/store/chat/{reducers/message.test.ts → slices/message/reducer.test.ts} +2 -2
  50. package/src/store/chat/{reducers/message.ts → slices/message/reducer.ts} +1 -1
  51. package/src/store/chat/{selectors/__tests__/chat.test.ts → slices/message/selectors.test.ts} +2 -2
  52. package/src/store/chat/{selectors/chat.ts → slices/message/selectors.ts} +3 -3
  53. package/src/store/chat/{actions/share.ts → slices/share/action.ts} +2 -2
  54. package/src/store/chat/slices/share/initialState.ts +7 -0
  55. package/src/store/chat/{actions/plugin.ts → slices/tool/action.ts} +2 -4
  56. package/src/store/chat/slices/tool/initialState.ts +7 -0
  57. package/src/store/chat/{actions/topic.test.ts → slices/topic/action.test.ts} +2 -2
  58. package/src/store/chat/{actions/topic.ts → slices/topic/action.ts} +3 -2
  59. package/src/store/chat/slices/topic/initialState.ts +23 -0
  60. package/src/store/chat/{selectors/__tests__/topic.test.ts → slices/topic/selectors.test.ts} +1 -1
  61. package/src/store/chat/{selectors/topic.ts → slices/topic/selectors.ts} +1 -1
  62. package/src/store/chat/store.ts +5 -5
  63. package/src/store/global/helpers.ts +1 -1
  64. package/src/store/global/index.ts +0 -1
  65. package/src/store/global/initialState.ts +6 -61
  66. package/src/store/global/selectors.ts +2 -2
  67. package/src/store/global/slices/{common.ts → common/action.ts} +3 -3
  68. package/src/store/global/slices/common/initialState.ts +55 -0
  69. package/src/store/global/{selectors/preference.ts → slices/common/selectors.ts} +1 -1
  70. package/src/store/global/slices/{settings.ts → settings/action.ts} +12 -4
  71. package/src/store/global/slices/settings/initialState.ts +15 -0
  72. package/src/store/global/{selectors/settings.test.ts → slices/settings/selectors.test.ts} +2 -2
  73. package/src/store/global/{selectors/settings.ts → slices/settings/selectors.ts} +3 -4
  74. package/src/store/global/store.ts +4 -18
  75. package/src/store/session/slices/agent/selectors.ts +2 -1
  76. package/src/store/session/slices/session/action.ts +2 -1
  77. package/src/tools/dalle/Render/ToolBar.tsx +2 -1
  78. package/src/types/exportConfig.ts +1 -1
  79. package/src/types/{chatMessage.ts → message/index.ts} +2 -2
  80. package/src/types/settings.ts +0 -29
  81. package/src/utils/fetch.ts +1 -1
  82. package/src/store/chat/selectors/index.ts +0 -3
  83. package/src/store/global/slices/agent.ts +0 -34
  84. /package/src/store/chat/{actions/enhance.ts → slices/enchance/action.ts} +0 -0
  85. /package/src/store/chat/{selectors/enchance.ts → slices/enchance/selectors.ts} +0 -0
  86. /package/src/store/chat/{actions/plugin.test.ts → slices/tool/action.test.ts} +0 -0
  87. /package/src/store/global/{selectors/__snapshots__/settings.test.ts.snap → slices/settings/__snapshots__/selectors.test.ts.snap} +0 -0
@@ -5,37 +5,8 @@ import { LocaleMode } from '@/types/locale';
5
5
  import type { LobeAgentSession } from '@/types/session';
6
6
 
7
7
  export interface GlobalBaseSettings {
8
- /**
9
- * @deprecated
10
- */
11
- OPENAI_API_KEY?: string;
12
-
13
8
  avatar: string;
14
- /**
15
- * @deprecated
16
- */
17
- compressThreshold?: number;
18
- /**
19
- * @deprecated
20
- */
21
- enableCompressThreshold?: boolean;
22
- /**
23
- * @deprecated
24
- */
25
- enableHistoryCount?: boolean;
26
- /**
27
- * @deprecated
28
- */
29
- enableMaxTokens?: boolean;
30
- /**
31
- * @deprecated
32
- */
33
- endpoint?: string;
34
9
  fontSize: number;
35
- /**
36
- * @deprecated
37
- */
38
- historyCount?: number;
39
10
  language: LocaleMode;
40
11
  neutralColor?: NeutralColors;
41
12
  password: string;
@@ -1,7 +1,7 @@
1
1
  import { t } from 'i18next';
2
2
 
3
- import { ChatMessageError } from '@/types/chatMessage';
4
3
  import { ErrorResponse, ErrorType } from '@/types/fetch';
4
+ import { ChatMessageError } from '@/types/message';
5
5
 
6
6
  export const getMessageError = async (response: Response) => {
7
7
  let chatMessageError: ChatMessageError;
@@ -1,3 +0,0 @@
1
- export { chatSelectors } from './chat';
2
- export { chatEnhanceSelectors } from './enchance';
3
- export { topicSelectors } from './topic';
@@ -1,34 +0,0 @@
1
- import { produce } from 'immer';
2
- import { DeepPartial } from 'utility-types';
3
- import type { StateCreator } from 'zustand/vanilla';
4
-
5
- import { LobeAgentSettings } from '@/types/session';
6
- import type { GlobalSettings } from '@/types/settings';
7
- import { merge } from '@/utils/merge';
8
- import { setNamespace } from '@/utils/storeDebug';
9
-
10
- import type { GlobalStore } from '../store';
11
-
12
- const n = setNamespace('settings');
13
-
14
- /**
15
- * 设置操作
16
- */
17
- export interface AgentAction {
18
- updateDefaultAgent: (agent: DeepPartial<LobeAgentSettings>) => void;
19
- }
20
-
21
- export const createAgentSlice: StateCreator<
22
- GlobalStore,
23
- [['zustand/devtools', never]],
24
- [],
25
- AgentAction
26
- > = (set, get) => ({
27
- updateDefaultAgent: (agent) => {
28
- const settings = produce(get().settings, (draft: GlobalSettings) => {
29
- draft.defaultAgent = merge(draft.defaultAgent, agent);
30
- });
31
-
32
- set({ settings }, false, n('updateDefaultAgent', agent));
33
- },
34
- });