@lobehub/chat 0.107.15 → 0.108.0
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.
- package/CHANGELOG.md +50 -0
- package/package.json +1 -1
- package/src/app/chat/features/Conversation/ChatList/index.tsx +2 -2
- package/src/app/settings/(desktop)/index.tsx +3 -2
- package/src/app/settings/common/Common.tsx +6 -1
- package/src/app/settings/common/index.tsx +3 -3
- package/src/app/settings/common/page.tsx +7 -1
- package/src/app/settings/page.tsx +4 -1
- package/src/config/server.ts +5 -1
- package/src/store/chat/actions/enhance.ts +2 -2
- package/src/store/chat/actions/message.ts +7 -7
- package/src/store/chat/actions/plugin.ts +2 -2
- package/src/store/chat/actions/topic.test.ts +391 -0
- package/src/store/chat/actions/topic.ts +2 -2
- package/src/store/chat/helpers.test.ts +109 -0
- package/src/store/chat/helpers.ts +10 -3
- package/src/store/chat/selectors/__tests__/chat.test.ts +251 -0
- package/src/store/chat/selectors/__tests__/topic.test.ts +1 -1
- package/src/store/chat/selectors/chat.ts +38 -38
- package/src/store/file/slices/images/action.ts +5 -5
- package/src/store/global/slices/agent.ts +2 -2
- package/src/store/global/slices/common.ts +6 -6
- package/src/store/global/slices/settings.ts +4 -4
- package/src/store/plugin/slices/customPlugin/action.ts +4 -4
- package/src/store/plugin/slices/plugin/action.ts +8 -8
- package/src/store/session/slices/session/action.ts +4 -4
|
@@ -17,7 +17,7 @@ import { setNamespace } from '@/utils/storeDebug';
|
|
|
17
17
|
import { PluginStore } from '../../store';
|
|
18
18
|
import { PluginDispatch, pluginManifestReducer } from './reducers/manifest';
|
|
19
19
|
|
|
20
|
-
const
|
|
20
|
+
const n = setNamespace('plugin');
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* 插件接口
|
|
@@ -73,7 +73,7 @@ export const createPluginSlice: StateCreator<
|
|
|
73
73
|
|
|
74
74
|
await installPlugins(plugins);
|
|
75
75
|
|
|
76
|
-
set({ manifestPrepared: true }, false,
|
|
76
|
+
set({ manifestPrepared: true }, false, n('checkPluginsIsInstalled'));
|
|
77
77
|
},
|
|
78
78
|
deletePluginSettings: (id) => {
|
|
79
79
|
set(
|
|
@@ -81,14 +81,14 @@ export const createPluginSlice: StateCreator<
|
|
|
81
81
|
draft.pluginsSettings[id] = undefined;
|
|
82
82
|
}),
|
|
83
83
|
false,
|
|
84
|
-
|
|
84
|
+
n('deletePluginSettings'),
|
|
85
85
|
);
|
|
86
86
|
},
|
|
87
87
|
dispatchPluginManifest: (payload) => {
|
|
88
88
|
const { pluginManifestMap } = get();
|
|
89
89
|
const nextManifest = pluginManifestReducer(pluginManifestMap, payload);
|
|
90
90
|
|
|
91
|
-
set({ pluginManifestMap: nextManifest }, false,
|
|
91
|
+
set({ pluginManifestMap: nextManifest }, false, n('dispatchPluginManifest', payload));
|
|
92
92
|
},
|
|
93
93
|
installPlugin: async (name) => {
|
|
94
94
|
const plugin = pluginSelectors.getPluginMetaById(name)(get());
|
|
@@ -140,12 +140,12 @@ export const createPluginSlice: StateCreator<
|
|
|
140
140
|
loadPluginStore: async () => {
|
|
141
141
|
const pluginMarketIndex = await pluginService.getPluginList();
|
|
142
142
|
|
|
143
|
-
set({ pluginList: pluginMarketIndex.plugins }, false,
|
|
143
|
+
set({ pluginList: pluginMarketIndex.plugins }, false, n('loadPluginList'));
|
|
144
144
|
|
|
145
145
|
return pluginMarketIndex;
|
|
146
146
|
},
|
|
147
147
|
resetPluginSettings: () => {
|
|
148
|
-
set({ pluginsSettings: {} }, false,
|
|
148
|
+
set({ pluginsSettings: {} }, false, n('resetPluginSettings'));
|
|
149
149
|
},
|
|
150
150
|
updateManifestLoadingState: (key, value) => {
|
|
151
151
|
set(
|
|
@@ -153,7 +153,7 @@ export const createPluginSlice: StateCreator<
|
|
|
153
153
|
draft.pluginManifestLoading[key] = value;
|
|
154
154
|
}),
|
|
155
155
|
false,
|
|
156
|
-
|
|
156
|
+
n('updateManifestLoadingState'),
|
|
157
157
|
);
|
|
158
158
|
},
|
|
159
159
|
updatePluginSettings: (id, settings) => {
|
|
@@ -162,7 +162,7 @@ export const createPluginSlice: StateCreator<
|
|
|
162
162
|
draft.pluginsSettings[id] = merge({}, draft.pluginsSettings[id], settings);
|
|
163
163
|
}),
|
|
164
164
|
false,
|
|
165
|
-
|
|
165
|
+
n('updatePluginSettings'),
|
|
166
166
|
);
|
|
167
167
|
},
|
|
168
168
|
|
|
@@ -18,7 +18,7 @@ import { setNamespace } from '@/utils/storeDebug';
|
|
|
18
18
|
|
|
19
19
|
import { initLobeSession } from './initialState';
|
|
20
20
|
|
|
21
|
-
const
|
|
21
|
+
const n = setNamespace('session');
|
|
22
22
|
|
|
23
23
|
const FETCH_SESSIONS_KEY = 'fetchSessions';
|
|
24
24
|
|
|
@@ -80,7 +80,7 @@ export const createSessionSlice: StateCreator<
|
|
|
80
80
|
SessionAction
|
|
81
81
|
> = (set, get) => ({
|
|
82
82
|
activeSession: (sessionId) => {
|
|
83
|
-
set({ activeId: sessionId }, false,
|
|
83
|
+
set({ activeId: sessionId }, false, n('activeSession'));
|
|
84
84
|
},
|
|
85
85
|
|
|
86
86
|
clearSessions: async () => {
|
|
@@ -153,7 +153,7 @@ export const createSessionSlice: StateCreator<
|
|
|
153
153
|
sessions: data,
|
|
154
154
|
},
|
|
155
155
|
false,
|
|
156
|
-
|
|
156
|
+
n('useFetchSessions/onSuccess', data),
|
|
157
157
|
);
|
|
158
158
|
},
|
|
159
159
|
}),
|
|
@@ -161,7 +161,7 @@ export const createSessionSlice: StateCreator<
|
|
|
161
161
|
useSearchSessions: (keyword) =>
|
|
162
162
|
useSWR<LobeSessions>(keyword, sessionService.searchSessions, {
|
|
163
163
|
onSuccess: (data) => {
|
|
164
|
-
set({ searchSessions: data }, false,
|
|
164
|
+
set({ searchSessions: data }, false, n('useSearchSessions(success)', data));
|
|
165
165
|
},
|
|
166
166
|
revalidateOnFocus: false,
|
|
167
167
|
}),
|